An ESLint plugin providing custom lint rules for AWS CDK projects, including rules like 'require-jsdoc', 'no-unused-props', 'prevent-construct-id-collision', and 'no-construct-in-interface'. Current stable version is 4.3.2, released under an active development cadence. It requires TypeScript and leverages type information via typescript-eslint. Differentiates from generic CDK linting by being specifically tailored to CDK constructs and patterns, offering both recommended and strict configs. Supports ESLint 8/9/10 and TypeScript 4.8+ to 6.x, and ships its own TypeScript type definitions.
npm install eslint-plugin-awscdkVerified import paths — ran on the pinned version, not inferred.
Shows flat ESLint config using the plugin with typescript-eslint, extending the recommended config and adding a custom rule.
Upgrade ESLint to ^8.57.0 || ^9.0.0 || ^10.0.0.
For classic .eslintrc, use 'plugin:awscdk/classicRecommended' instead of 'plugin:awscdk/recommended'. For flat config, use cdkPlugin.configs.recommended.
Uninstall eslint-cdk-plugin and install eslint-plugin-awscdk@4. Update imports and config accordingly.
Configure parserOptions.project in .eslintrc or use typescript-eslint's typed configs in flat config.
Ensure you are using @typescript-eslint/parser with project option, or use only rules that do not require types.
Use 'awscdk/no-construct-in-public-property' instead.
Run `npm install -D eslint-plugin-awscdk` or `pnpm install -D eslint-plugin-awscdk`.
Use `import cdkPlugin from 'eslint-plugin-awscdk'` and then `cdkPlugin.configs.recommended`. Do not use destructured import.
Use the correct config format: for flat config, import the plugin; for classic config, use the string 'eslint-plugin-awscdk' in plugins array.
Set parserOptions.project to './tsconfig.json' (or the correct path) in your ESLint config.