Repository navigation
fix(lint): migrate .eslintrc.js to ESLint 9 flat config - #9
Merged
Merged
Conversation
ESLint 9 requires eslint.config.js (flat config); the legacy .eslintrc.js was never migrated, so npm run lint has been broken since the eslint 9 bump - no working lint gate locally or in CI. - Replace .eslintrc.js with eslint.config.mjs preserving rule intent: typescript-eslint recommended, type-aware parsing against tsconfig.json, prettier via eslint-plugin-prettier/recommended + eslint-config-prettier, and the legacy 'off' overrides (interface-name-prefix dropped - the rule no longer exists in v8 and would fail config load) - Add missing devDeps: typescript-eslint (umbrella) and globals (ESLint 9 dropped env; node+jest globals declared explicitly) - Map legacy ignorePatterns to flat global ignores (__test__ stays deliberately unlinted; createChart.ts and script.js unchanged; dist added as hardening for bare 'eslint .' runs) - Fix the 3 findings from the first real lint run in months: unused catch params in handlers.ts (optional catch binding; tsc downlevels it for the es2017 target) and one over-width line in utils.ts - Simplify the lint glob to src/**/*.ts (top-level styles/types/interfaces dirs don't exist) and drop --fix so lint works as a CI gate; lint:fix keeps the autofix workflow - Run npm run lint in the Node.js CI workflow between npm ci and npm test Refs chicks-net/chicks-projects#133
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the broken lint gate.
npm run linthas failed on every invocation since ESLint was bumped to 9.x (commit aab881e) because the legacy.eslintrc.jswas never migrated to flat config — so the repo has had no working lint gate at all, locally or in CI.Refs chicks-net/chicks-projects#133
What changed
eslint.config.mjsreplaces.eslintrc.js, preserving rule intent:typescript-eslintrecommended (type-aware parsing againsttsconfig.json)eslint-plugin-prettier/recommended+eslint-config-prettier'off'overrides kept (explicit-function-return-type,explicit-module-boundary-types,no-explicit-any)@typescript-eslint/interface-name-prefixdropped — the rule was removed from typescript-eslint long before v8 and would fail config loadtypescript-eslint@8.41.0(umbrella with the flatconfigs/config()helpers) andglobals@17.13.0(ESLint 9 droppedenv; node + jest globals now declared explicitly)ignorePatterns→ flat globalignores—src/createChart.ts,__test__/**,script.jsunchanged;__test__stays deliberately unlinted to keep parity with the pre-migration effective behavior;dist/**added as hardening in case anyone runs a barenpx eslint .src/handlers.ts×2: unusedcatch (error)params → optional catch bindingcatch {}(the catches deliberately swallow and send a fallback SVG; tsc 5.9 downlevels the syntax for thees2017target, verified)src/utils.ts: one over-width line, reformatted per prettierpackage.jsonscripts: lint glob simplified tosrc/**/*.ts(top-levelstyles/,types/,interfaces/dirs don't exist — they live undersrc/), and--fixdropped fromlintso it works as a real CI gate; newlint:fixkeeps the autofix workflownpm run lintadded to the Node.js workflow betweennpm ciandnpm test— the natural gate now that CI runs on deploy PRsVerification
npm run lint— clean (first passing run since the 9.x bump)npm test— 16 passing, 4 suites (same as baseline)npm run build— cleannpx prettier --check "src/**/*.ts"— all formatted, no.prettierrcchangesNode 26.12.1 (current
nodeon macOS/homebrew) has a native crash bug: any ESLint invocation dies with SIGABRT inside Node's own module-resolution code (ParsePackageJSON), before any config is even read. That's a Node bug, not this repo — nothing to fix here. Until Node patches it, run lint/tests with Node 22/24 (e.g.PATH="/opt/homebrew/opt/node@24/bin:$PATH" npm run lint). CI (Node 22.x) is unaffected.