From fd05116bc1ed490077a0c90bfad4a18390da3629 Mon Sep 17 00:00:00 2001 From: Roman Vyakhirev Date: Tue, 10 Feb 2026 16:58:49 +0100 Subject: [PATCH] chore: describe how to deal with linting errors --- .github/copilot-instructions.md | 4 ++-- AGENTS.md | 28 ++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d85a277c43..a11b4cb076 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -10,7 +10,7 @@ Use this guide to review both code and workflow. Focus on Mendix pluggable widge - `packages/customWidgets/*` - `packages/shared/*` (configs, plugins) - **Stack**: TypeScript, React, SCSS, Rollup via `@mendix/pluggable-widgets-tools`, Jest/RTL, ESLint/Prettier. -- **Commands** (root): `pnpm lint`, `pnpm test`, `pnpm build`, `pnpm -w changelog`, `pnpm -w version`. +- **Commands** (root): `pnpm lint`, `pnpm test`, `pnpm build`, `pnpm -w changelog`. ## What to check on every PR @@ -319,7 +319,7 @@ This repository uses a comprehensive three-tier testing strategy: - Build: `pnpm build` - E2E (dev): `pnpm e2edev` (with GUI debugger) - E2E (CI): `pnpm e2e` (headless) -- Prepare changelog/version (workspace): `pnpm -w changelog`, `pnpm -w version` +- Prepare changelog (workspace): `pnpm -w changelog` ## Tone and format for comments diff --git a/AGENTS.md b/AGENTS.md index 2b77c77fc7..036173d12e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,7 +55,6 @@ Key commands for working with this repository: - **`pnpm test`** - Run unit tests across all packages - **`pnpm build`** - Build all packages - **`pnpm -w changelog`** - Update changelogs -- **`pnpm -w version`** - Bump versions across packages ## AI Development Assistant Context @@ -91,4 +90,29 @@ When working on this repository, prioritize: 4. **Building**: Use `pnpm build` or `pnpm start` for development builds 5. **Testing**: Use `pnpm test` for unit tests, `pnpm e2e` for E2E tests -For detailed implementation guidance, refer to the specific requirement documents linked above. \ No newline at end of file +For detailed implementation guidance, refer to the specific requirement documents linked above. + +## How-To's + +### Code Linting + +ESLint with Prettier integration handles code quality and formatting. Fix errors using cli as much as possible, manual fixing is a last resort. + +#### Key Rules + +1. **Location**: Always `cd` into widget directory (e.g., `packages/pluggableWidgets/combobox-web/`) before running lint commands +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 +3. **Focus**: Fix only errors and warnings in files you modified; ignore warnings in untouched files + +#### Workflow + +1. **Check**: Run `pnpm run lint` + - Output shows `prettier/prettier` violations (formatting) and ESLint rule errors + +2. **Auto-fix**: Run `pnpm run lint --fix` + - Fixes Prettier formatting and auto-fixable ESLint rules + - Note: after fixes, this checks for errors as `pnpm run lint` would do, no need to rerun `pnpm run lint` before next step + +3. **Manual fix**: Edit code directly for remaining errors + +4. **Verify**: Re-run `pnpm run lint` until output shows 0 errors or passes silently