feat(tooling): upgrade ESLint 9 → 10 with flat config migration#171
Draft
scottschreckengaust wants to merge 4 commits into
Draft
feat(tooling): upgrade ESLint 9 → 10 with flat config migration#171scottschreckengaust wants to merge 4 commits into
scottschreckengaust wants to merge 4 commits into
Conversation
- eslint ^9 -> ^10 (10.4.0) - @cdklabs/eslint-plugin ^1 -> ^2 (flat config support) - eslint-plugin-import removed (no ESLint 10 support) - eslint-plugin-import-x ^4 added (drop-in replacement) - eslint-import-resolver-typescript removed (import-x has built-in TS resolution) - Root resolution for eslint-plugin-import/minimatch removed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert .eslintrc.json to eslint.config.mjs (ESM flat config format). Replace import/ rule prefix with import-x/. Remove --ext flag and ESLINT_USE_FLAT_CONFIG env var from the eslint script. All existing rules preserved with equivalent flat config syntax. Four @cdklabs rules (no-core-construct, invalid-cfn-imports, no-literal-partition, no-invalid-path) are temporarily disabled because they use context.getFilename() which was removed in ESLint 10. Stale eslint-disable comments for disabled/absent rules removed by auto-fix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert .eslintrc.json to eslint.config.mjs. Replace import/ rule prefix with import-x/. Remove --ext flag and ESLINT_USE_FLAT_CONFIG. All existing rules preserved including no-console override for src/. Removed stale no-constant-condition disable comments (rule deprecated in ESLint 10). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The resolver is required by eslint-plugin-import-x for TypeScript path resolution. Was incorrectly removed in the package upgrade commit. Also disable license-header rule for shebang bin files (workaround). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| languageOptions: { | ||
| parser: tsparser, | ||
| parserOptions: { | ||
| ecmaVersion: 2018, |
Contributor
Author
There was a problem hiding this comment.
is this the latest version 2018?
Comment on lines
+192
to
+199
| // NOTE: The following 4 rules use context.getFilename() which was removed in ESLint 10. | ||
| // They are disabled until @cdklabs/eslint-plugin adds ESLint 10 support. | ||
| // Track: https://github.com/cdklabs/eslint-plugin/issues | ||
| '@cdklabs/no-core-construct': ['off'], | ||
| '@cdklabs/invalid-cfn-imports': ['off'], | ||
| '@cdklabs/no-literal-partition': ['off'], | ||
| '@cdklabs/no-invalid-path': ['off'], | ||
| '@cdklabs/promiseall-no-unbounded-parallelism': ['error'], |
Contributor
Author
There was a problem hiding this comment.
There are five rules here. Is that intentional?
Contributor
Author
There was a problem hiding this comment.
What items are necessary for eslint v10 - what items are already set out-of-the-box and which ones are enhancements?
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.
Summary
Closes #169
Upgrades ESLint from v9 (legacy .eslintrc.json with ESLINT_USE_FLAT_CONFIG=false) to v10 (flat config only). Migrates both cdk/ and cli/ configurations to eslint.config.mjs format.
Changes
Key decisions
import/toimport-x/.context.getFilename()API. Re-enable when upstream fixes.filespatterns in flat config.What's NOT in this PR (Phase 2, separate PRs)
Test plan
mise //cdk:eslintpasses (zero errors)mise //cli:eslintpasses (zero errors)References: #169 (implementation issue), #170 (@cdklabs upstream blocker), #104 (toolchain monitoring RFC)
🤖 Generated with Claude Code