Summary
Four @cdklabs/eslint-plugin rules are disabled in cdk/eslint.config.mjs because they use the deprecated context.getFilename() API which was removed in ESLint 10. Re-enable them when cdklabs publishes a fix.
Disabled rules
| Rule |
Purpose |
@cdklabs/no-core-construct |
Prevents use of deprecated core Construct class |
@cdklabs/invalid-cfn-imports |
Validates CloudFormation import patterns |
@cdklabs/no-literal-partition |
Catches hardcoded AWS partition strings |
@cdklabs/no-invalid-path |
Validates path references |
Root cause
ESLint 10 removed context.getFilename() (deprecated since ESLint 9.x). The replacement is context.filename. The @cdklabs/eslint-plugin@2.0.6 (latest as of 2026-05-22) still calls the removed API, causing runtime errors during linting.
promiseall-no-unbounded-parallelism remains enabled as it doesn't use the deprecated API.
Action required
- Monitor
@cdklabs/eslint-plugin releases for a version that uses context.filename
- When published: bump the dependency and remove the
off overrides from cdk/eslint.config.mjs
- Re-run
mise //cdk:eslint — the 3 file-level @cdklabs/no-literal-partition suppressions in cdk/src/bootstrap/policies/ will become active again
Upstream
Related
Summary
Four
@cdklabs/eslint-pluginrules are disabled incdk/eslint.config.mjsbecause they use the deprecatedcontext.getFilename()API which was removed in ESLint 10. Re-enable them when cdklabs publishes a fix.Disabled rules
@cdklabs/no-core-construct@cdklabs/invalid-cfn-imports@cdklabs/no-literal-partition@cdklabs/no-invalid-pathRoot cause
ESLint 10 removed
context.getFilename()(deprecated since ESLint 9.x). The replacement iscontext.filename. The@cdklabs/eslint-plugin@2.0.6(latest as of 2026-05-22) still calls the removed API, causing runtime errors during linting.promiseall-no-unbounded-parallelismremains enabled as it doesn't use the deprecated API.Action required
@cdklabs/eslint-pluginreleases for a version that usescontext.filenameoffoverrides fromcdk/eslint.config.mjsmise //cdk:eslint— the 3 file-level@cdklabs/no-literal-partitionsuppressions incdk/src/bootstrap/policies/will become active againUpstream
eslint >=9 <11— claims ESLint 10 support but uses removed API)Related