Lint: stop working around rules that don't fit tests, e2e and the API #398
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amaurycoudr/chess-project#398
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
An audit of the lint config (on the accounts spec's branch, after the owner's
new-cap,max-paramsandmax-lineschanges landed in !523) found rules the code keeps working around: suppressions, the same override copied per package, and testdescribeblocks split only to fit a size limit. They cost more than they catch in tests, inapps/e2eand in the API.Changes, one lint merge request, in order
.oxlintrc.json: add**/*.handlers.ts(the front's MSW fakes) to its files, and turn offeslint/max-lines-per-function,eslint/no-await-in-loop,eslint/init-declarationsandpromise/avoid-new. Drop the copies of these in the API, front and e2e overrides.room-footer.test.tsx,room-offers.test.tsxandroom.handlers.ts.auth.signUpin four, the "own move" trio inroom.test.tsx), and foldbrowserOnback intoconnectinrpc.fixtures.ts.eslint/max-lines-per-functionin source: keep 80, withskipBlankLines: trueandskipComments: true.apps/e2eruns in Node: a root override withenv: { node: true }andimport/no-nodejs-modules: off. Check that oxlint acceptsenvinside an override. Delete the threeno-undefsuppressions and theplaywright.config.tsoverride.unicorn/no-nulloff forapps/api: Drizzle rows and the wire's.nullable()are null-shaped, andstrictNullChecksalready catches misuse; the front has it off already. Delete the file-by-file allowlist. Keep it on in the engine.unicorn/require-array-join-separatorinapps/apifrom all ofroom/to the one file defining the Room'sjoin(a false positive on a method name). Optionally allowreflect-metadatainimport/no-unassigned-importand dropapp.ts's suppression.Stays as it is
typescript/consistent-type-definitions: its 3 suppressions are declaration merging, which needs aninterface.no-magic-numbers: one suppression, a cubic-bezier value.promise/prefer-await-to-theningames.service.ts: it flags a real fire-and-forget.front/no-vi-mockinrouter.harness.tsx, the scoped offs inuse-room-changes.ts,move-mutation.ts'sno-set-query-data, the shadcn folder,jsx-a11y/anchor-is-valid,id-length,prefer-destructuring.Acceptance criteria
Out of scope
no-restricted-importsblocks, repeated nearly word for word for each of its 6 verticals (about 1,000 lines of config): worth its own merge request.new-cap,max-paramsandmax-lines: already changed in !523.mentioned in merge request !523
mentioned in commit
afee5e1d62mentioned in merge request !524