ESLint plugin for AWS CDK projects that enforces best practices and prevents common mistakes. Current stable version is 3.4.9. It is being renamed to eslint-plugin-awscdk starting from v4.0.0 to follow ESLint's naming convention. The package provides lint rules specific to CDK constructs, such as preventing construct ID collisions, ensuring proper use of stacks, and avoiding constructs in interfaces. It requires Node.js ^18.18.0 || ^20.9.0 || >=21.1.0, ESLint ^8.57.0 || ^9.0.0 || ^10.0.0, and TypeScript >=4.8.4 <6.1.0. Ships TypeScript types. Key differentiators: type-aware rules for CDK constructs, migration path from old package name, recommended config integration with typescript-eslint.
Verified import paths — ran on the pinned version, not inferred.
ESM-only since v3. Requires flat config (eslint.config.mjs). For require, use dynamic import or upgrade to v4 with eslint-plugin-awscdk.
For v3.x, use old package name. v4+ uses eslint-plugin-awscdk. Ensure correct import to avoid 'plugin not found' errors.
refer to the plugin object itself, not its config, when setting up custom rules.
config is an object, not a string. Use object spread or reference directly.
Sets up flat config with recommended CDK rules using typescript-eslint. Files scope limits to CDK sources.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.