Skip to content

Commit fd05116

Browse files
committed
chore: describe how to deal with linting errors
1 parent fb69a11 commit fd05116

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Use this guide to review both code and workflow. Focus on Mendix pluggable widge
1010
- `packages/customWidgets/*`
1111
- `packages/shared/*` (configs, plugins)
1212
- **Stack**: TypeScript, React, SCSS, Rollup via `@mendix/pluggable-widgets-tools`, Jest/RTL, ESLint/Prettier.
13-
- **Commands** (root): `pnpm lint`, `pnpm test`, `pnpm build`, `pnpm -w changelog`, `pnpm -w version`.
13+
- **Commands** (root): `pnpm lint`, `pnpm test`, `pnpm build`, `pnpm -w changelog`.
1414

1515
## What to check on every PR
1616

@@ -319,7 +319,7 @@ This repository uses a comprehensive three-tier testing strategy:
319319
- Build: `pnpm build`
320320
- E2E (dev): `pnpm e2edev` (with GUI debugger)
321321
- E2E (CI): `pnpm e2e` (headless)
322-
- Prepare changelog/version (workspace): `pnpm -w changelog`, `pnpm -w version`
322+
- Prepare changelog (workspace): `pnpm -w changelog`
323323
324324
## Tone and format for comments
325325

AGENTS.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ Key commands for working with this repository:
5555
- **`pnpm test`** - Run unit tests across all packages
5656
- **`pnpm build`** - Build all packages
5757
- **`pnpm -w changelog`** - Update changelogs
58-
- **`pnpm -w version`** - Bump versions across packages
5958

6059
## AI Development Assistant Context
6160

@@ -91,4 +90,29 @@ When working on this repository, prioritize:
9190
4. **Building**: Use `pnpm build` or `pnpm start` for development builds
9291
5. **Testing**: Use `pnpm test` for unit tests, `pnpm e2e` for E2E tests
9392

94-
For detailed implementation guidance, refer to the specific requirement documents linked above.
93+
For detailed implementation guidance, refer to the specific requirement documents linked above.
94+
95+
## How-To's
96+
97+
### Code Linting
98+
99+
ESLint with Prettier integration handles code quality and formatting. Fix errors using cli as much as possible, manual fixing is a last resort.
100+
101+
#### Key Rules
102+
103+
1. **Location**: Always `cd` into widget directory (e.g., `packages/pluggableWidgets/combobox-web/`) before running lint commands
104+
2. **Command**: Use `pnpm run lint` (with optional `--fix` for fixing), this is custom command, not eslint - do not pass any extra arguments or filenames
105+
3. **Focus**: Fix only errors and warnings in files you modified; ignore warnings in untouched files
106+
107+
#### Workflow
108+
109+
1. **Check**: Run `pnpm run lint`
110+
- Output shows `prettier/prettier` violations (formatting) and ESLint rule errors
111+
112+
2. **Auto-fix**: Run `pnpm run lint --fix`
113+
- Fixes Prettier formatting and auto-fixable ESLint rules
114+
- Note: after fixes, this checks for errors as `pnpm run lint` would do, no need to rerun `pnpm run lint` before next step
115+
116+
3. **Manual fix**: Edit code directly for remaining errors
117+
118+
4. **Verify**: Re-run `pnpm run lint` until output shows 0 errors or passes silently

0 commit comments

Comments
 (0)