Skip to content

chore(eslint): re-enable @cdklabs rules after plugin fixes deprecated context.getFilename() #170

@scottschreckengaust

Description

@scottschreckengaust

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

  1. Monitor @cdklabs/eslint-plugin releases for a version that uses context.filename
  2. When published: bump the dependency and remove the off overrides from cdk/eslint.config.mjs
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions