feat!: migrate to ESLint 10 native flat config - #95
Open
uPaymeiFixit wants to merge 9 commits into
Open
Conversation
…^10, engines node >=20.19, lockfile regen Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… fix to ExportAllDeclaration Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- YAML packages (browser/cli/nest) converted to built TS packages - eslint-plugin-import → eslint-plugin-import-x registered under the import namespace - typescript-eslint 8, eslint-plugin-n 18, jest 29, promise 7, react-hooks 7 (classic pair pinned) - foreign-rule relaxations relocated to their owning packages - cli gains an empty ./lenient export - json-files rules consolidated into one **/*.json config with explicit processor Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… delete all .eslintrc.yaml Also: ESLint 10 context-method shims for json-files/react/jsx-a11y plugins, import-x resolver-next wiring, type-aware linting disabled for config files, eslint.config.* exempted from import/no-default-export. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- initESLint uses overrideConfigFile:true + flat overrideConfig; tmp-dir tests get cwd-scoped linters - utils workspace goes ESM with a typed exports map (fixes Node 24 interop + phantom any types) - test configs import the flat arrays instead of eslintrc extends strings - base covers the full JS/TS file family (parity with the old --ext ts,js,json behavior) - json-files processor gains the meta object ESLint 10's --cache requires - switch-exhaustiveness-check pinned to v7 semantics (considerDefaultExhaustiveForUnions) - test snippets updated for eslint 10 / typescript-eslint 8 forced rule deltas Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
v7's eslintrc version only applied to *.ts; v8's flat version is universal, which silently turned off no-undef & friends for plain JS. Also pin switch-exhaustiveness-check to v7 semantics. Found via pre/post --print-config diff audit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- flat-config imports + defineConfig in today's exact layering order - eslint installed as a direct devDependency (it's a peer of the config packages now) - lint:js drops --ext (files globs govern extensions); uninstall list gains import-x/@types/eslint/@rushstack-eslint-patch; removal set covers legacy eslintrc files and .eslintignore - specs assert the import list and defineConfig call; new cli+lenient case Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… release/dist-tag policy Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Migrates every
@code-style/eslint-config*package from ESLint 8 /.eslintrcto native ESLint 10 flat config, plus the scaffolder, test harness, self-linting, CI, and docs. Rule content is preserved except where the forced plugin majors changed it (audited — see below).Context: Paciolan's Maps team is standardizing code style and is willing to adopt code-style if it's on a current ESLint (their spike rejected it primarily over ESLint 8 EOL / eslintrc). This unblocks that, and a follow-up will add the frontend layers (tanstack-query etc.).
Headline decisions
^10.0.0), Node engines^20.19.0 || ^22.13.0 || >=24."type": "module", esbuild--format=esm). Verified safe for CJS consumers: configs are only loaded througheslint.config.mjs, and Node ≥20.19require(esm)covers the rest (smoke-tested from a"type": "commonjs"project).Linter.Config[]arrays; consumers compose withdefineConfig. Layering philosophy unchanged — later entries still win.eslint-plugin-import→eslint-plugin-import-x, registered under theimportnamespace so everyimport/*rule ID and inline disable keeps working. TS resolution viaresolver-next+eslint-import-resolver-typescript.-browser,-cli,-nest) converted to built TS packages;-cligains the./lenientexport create-configs was already emitting (previously a dead subpath).@rushstack/eslint-patchdeleted everywhere (plugins are real imports now).rules-of-hooks/exhaustive-deps) — adopting the React Compiler rule set should be a deliberate versioned change.eslint.config.mjs, installseslintas a direct devDependency, drops--ext, and removes legacy eslintrc files +.eslintignoreon overwrite.ESLint 10 compat shims (temporary)
eslint-plugin-react,eslint-plugin-jsx-a11y, andeslint-plugin-json-filesstill call rule-context methods ESLint 10 removed (context.getFilename()etc.), and the first two still cap their peer ranges at ESLint 9. Small prototype-chain shims wrap their rules (eslint-config-react/src/compat.ts,eslint-config/src/overrides/json.ts) — delete when upstream catches up. The json-files processor also gets themetaobject v10's--cacherequires.Behavior deltas (from the pre/post
--print-configaudit)Snapshotted effective configs for js/ts/test/json/tsx files before and after; every delta traces to a documented upstream change:
recommendedadditions (no-useless-assignment,preserve-caught-error, …)ban-typessplit,no-throw-literal→only-throw-error, …);switch-exhaustiveness-checkpinned to v7 semanticsThe audit also caught (and this PR fixes) one would-be regression: tseslint v8's flat
eslint-recommendeddisables core rules likeno-undefuniversally, where v7's was TS-scoped — it's re-scoped to TS files.One deliberate fix in
eslint-plugin-nest: theno-barrelingsuggestion now removes the offendingexport * fromdeclaration instead of the whole Program (v10 widenedProgram.rangeto include comments, which would have made the old fix worse).Verification
scripts/e2e-create-configs.sh) that packs all workspaces into a throwaway verdaccio registry, scaffolds a sample project non-interactively, and proves the generated config catches a seeded violation and passes a clean file."type": "commonjs"project incl.require('@code-style/eslint-config').Not in this PR (deliberate)
bump.tspremajor →3.0.0-Nwith"publishConfig": { "tag": "next" }added to every workspace in the same commit, so prereleases don't capturelatest(the publish action runs a barenpm publish).^2.0.0-35consumers can never resolve 3.x, so the existing fleet is safe.Migration guide for consumers:
docs/migrating-v2-to-v3.md.🤖 Generated with Claude Code