feat(tooling): upgrade ESLint 9 → 10 with flat config migration#171
Merged
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>
Contributor
|
After merging main, one build step is failing -> https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/actions/runs/26470546246/job/77942514576?pr=171 |
ESLint --fix removes no-op suppression comments for rules not enabled in our config. These were introduced by the attachments PR (#176) merge and are cleaned up by the new ESLint 10 flat config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced May 26, 2026
krokoko
approved these changes
May 26, 2026
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/. The original plugin has no ESLint 10 support.context.getFilename()API. Re-enable when upstream fixes.Removals and why
.eslintrc.json(cdk/, cli/)--ext .ts,.tsxflag in lint scriptsfiles: [...]patterns instead;--extis removed in ESLint 10ESLINT_USE_FLAT_CONFIG=falseenv vareslint-plugin-importpackageeslint-plugin-import-x(no ESLint 10 support in original)eslint-plugin-import/minimatchresolution (root package.json)eslint-plugin-import's transitive deps. Since the plugin is removed, the transitive dep no longer exists"extends": ["plugin:import/typescript"]extends; equivalent settings are inline in the configStale suppression comments removed (auto-fix)
ESLint's
--fixremoves suppression comments that target rules no longer active. These were cleaned up:@cdklabs/no-literal-partitionoff(disabled due to upstream bug) — suppression is redundantno-constant-condition@cdklabs/promiseall-no-unbounded-parallelism@typescript-eslint/no-explicit-any@typescript-eslint/no-unused-vars@typescript-eslint/no-var-requires, @typescript-eslint/no-require-importsno-require-importsrule is active but the suppressed line was in test code that no longer triggers itTotal: 17 stale suppression comments removed. No behavioral changes — these suppressions were already no-ops.
What's NOT in this PR (follow-on PRs per #169)
ecmaVersion: 2018(ESLint 10 defaults to"latest"),sourceType: 'module'(also default)no-unassigned-vars,no-useless-assignment,preserve-caught-errorcontext.getFilename()APITest plan
mise //cdk:eslintpasses (zero errors)mise //cli:eslintpasses (zero errors)tsc --noEmit)References: #169 (implementation issue + follow-on list), #170 (@cdklabs upstream blocker), #104 (toolchain monitoring RFC)
🤖 Generated with Claude Code