chore(repo): stop working around lint rules that do not fit tests, e2e and the API #524

Merged
root merged 1 commit from claude/lint-audit-398-fd284c into main 2026-10-14 13:58:05 +00:00
root commented 2026-10-14 13:36:52 +00:00 (Migrated from gitlab.core-project.space)

Summary

Steps 1 to 5 of #398, checked against current main. Each config change also deletes the suppressions and override copies it makes unnecessary.

 .oxlintrc.json
   rules
-    max-lines-per-function: { max: 80 }
+    max-lines-per-function: { max: 80, skipBlankLines, skipComments }
   overrides
-    tests: no-explicit-any, no-magic-numbers
-    tests + *.handlers.ts: max-lines
+    tests + *.handlers.ts: no-explicit-any, no-magic-numbers, max-lines,
+                           max-lines-per-function, no-await-in-loop,
+                           init-declarations, promise/avoid-new
-    apps/e2e/**: no-await-in-loop
-    apps/e2e/playwright.config.ts: no-undef
+    apps/e2e/**: env node, import/no-nodejs-modules off

 apps/api/.oxlintrc.json
   rules
+    unicorn/no-null: off
+    import/no-unassigned-import: allow reflect-metadata
   overrides
-    src/room/**: require-array-join-separator off
-    tests: init-declarations, no-await-in-loop, avoid-new, require-array-join-separator
-    room.service.ts + tests: no-null

 apps/front/.oxlintrc.json
   tests
-    init-declarations off

Suppressions deleted (7): room-footer.test.tsx, room-offers.test.tsx (its reason is kept as a plain comment), room.handlers.ts, the e2e targets.ts, tests/mailbox.ts and playwright.screenshots.config.ts, and the API's app.ts. No new suppression is added.

Deviations from the issue

  • Step 5: require-array-join-separator is back on across the whole API, rather than narrowed to one file. On main, nothing in apps/api defines a Room join any more, and every .join( call passes a separator. With the rule on everywhere, the API lints clean, so both overrides that turned it off are deleted (room/ and tests).
  • Step 1: the root's two test overrides covered the same files, so they are now one block.
  • Optional items skipped: the describe merges and the browserOn fold. The split blocks are named by theme (Username rules, password rules, before / once the server answers), and each reads better than one merged block would.

Evidence

  • env inside an override works. With it removed, apps/e2e reports eslint(no-undef): 'process' is not defined many times; with it in place, 0 errors.
  • The reflect-metadata allow is narrow. A probe file with import "zod"; still fails import/no-unassigned-import, while app.ts passes.
  • require-array-join-separator still fires. A probe ["a"].join() under src/room/ fails, and the real code passes.
  • Before: 7 inline suppressions and 6 override copies. After: pnpm lint, typecheck, test (engine 742, api 730, front 1216), build and format:check are all green.

Proposed rule changes

  • Root CODING_STANDARDS.md rule 9 says "Outside tests, numbers … are named constants". The *.handlers.ts MSW fakes in apps/front/src now lint as tests, so the rule could read "outside tests and their fakes" to match.

Merge Danger

Door: two-way

Blast Radius: lint-only

Nothing changes at runtime. Lint is looser in tests, handlers, apps/e2e and the API's nulls, and stricter for join separators in the API.

Closes #398

## Summary Steps 1 to 5 of #398, checked against current main. Each config change also deletes the suppressions and override copies it makes unnecessary. ```diff .oxlintrc.json rules - max-lines-per-function: { max: 80 } + max-lines-per-function: { max: 80, skipBlankLines, skipComments } overrides - tests: no-explicit-any, no-magic-numbers - tests + *.handlers.ts: max-lines + tests + *.handlers.ts: no-explicit-any, no-magic-numbers, max-lines, + max-lines-per-function, no-await-in-loop, + init-declarations, promise/avoid-new - apps/e2e/**: no-await-in-loop - apps/e2e/playwright.config.ts: no-undef + apps/e2e/**: env node, import/no-nodejs-modules off apps/api/.oxlintrc.json rules + unicorn/no-null: off + import/no-unassigned-import: allow reflect-metadata overrides - src/room/**: require-array-join-separator off - tests: init-declarations, no-await-in-loop, avoid-new, require-array-join-separator - room.service.ts + tests: no-null apps/front/.oxlintrc.json tests - init-declarations off ``` Suppressions deleted (7): `room-footer.test.tsx`, `room-offers.test.tsx` (its reason is kept as a plain comment), `room.handlers.ts`, the e2e `targets.ts`, `tests/mailbox.ts` and `playwright.screenshots.config.ts`, and the API's `app.ts`. No new suppression is added. **Deviations from the issue** - **Step 5:** `require-array-join-separator` is back on across the whole API, rather than narrowed to one file. On main, nothing in `apps/api` defines a Room `join` any more, and every `.join(` call passes a separator. With the rule on everywhere, the API lints clean, so both overrides that turned it off are deleted (`room/` and tests). - **Step 1:** the root's two test overrides covered the same files, so they are now one block. - **Optional items skipped:** the describe merges and the `browserOn` fold. The split blocks are named by theme (Username rules, password rules, before / once the server answers), and each reads better than one merged block would. ## Evidence - `env` inside an override works. With it removed, `apps/e2e` reports `eslint(no-undef): 'process' is not defined` many times; with it in place, 0 errors. - The `reflect-metadata` allow is narrow. A probe file with `import "zod";` still fails `import/no-unassigned-import`, while `app.ts` passes. - `require-array-join-separator` still fires. A probe `["a"].join()` under `src/room/` fails, and the real code passes. - **Before:** 7 inline suppressions and 6 override copies. **After:** `pnpm lint`, `typecheck`, `test` (engine 742, api 730, front 1216), `build` and `format:check` are all green. ## Proposed rule changes - Root `CODING_STANDARDS.md` rule 9 says "Outside tests, numbers … are named constants". The `*.handlers.ts` MSW fakes in `apps/front/src` now lint as tests, so the rule could read "outside tests and their fakes" to match. ## Merge Danger **Door:** two-way **Blast Radius:** lint-only Nothing changes at runtime. Lint is looser in tests, handlers, `apps/e2e` and the API's nulls, and stricter for join separators in the API. Closes #398
project_1_bot_a8dd9262857d850eef8dca5206e61de5 commented 2026-10-14 13:43:47 +00:00 (Migrated from gitlab.core-project.space)

Screenshots

Before is production, after is this merge request's review app at afee5e1.

Desktop

Page Before After
Home
Local game
Room

Mobile

Page Before After
Home
Local game
Room
<!-- chess-screenshots --> ### Screenshots Before is production, after is this merge request's review app at afee5e1. #### Desktop | Page | Before | After | | --- | --- | --- | | Home | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/before/home-desktop.png" width="400"> | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/after/home-desktop.png" width="400"> | | Local game | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/before/local-desktop.png" width="400"> | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/after/local-desktop.png" width="400"> | | Room | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/before/room-desktop.png" width="400"> | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/after/room-desktop.png" width="400"> | #### Mobile | Page | Before | After | | --- | --- | --- | | Home | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/before/home-mobile.png" width="200"> | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/after/home-mobile.png" width="200"> | | Local game | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/before/local-mobile.png" width="200"> | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/after/local-mobile.png" width="200"> | | Room | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/before/room-mobile.png" width="200"> | <img src="https://gitlab.core-project.space/amaurycoudr/chess-project/-/jobs/912/artifacts/raw/review-screenshots/after/room-mobile.png" width="200"> |
root (Migrated from gitlab.core-project.space) merged commit into main 2026-10-14 13:58:05 +00:00
Sign in to join this conversation.
No description provided.