Skip to content

Rules

Rules Reference

Rules enabled when using the recommended configuration.
🔧
Rules that can be automatically fixed using the --fix option.

We currently support the following rules:

The recommended rules are suggested for maintaining correct code.
To use these rules, configure as follows:

js
// eslint.config.mjs
import cdkPlugin from "eslint-cdk-plugin";
import tsEslint from "typescript-eslint";

export default [
  ...tsEslint.configs.recommended,
  // ✅ Add plugins
  cdkPlugin.configs.recommended,
  {
    files: ["lib/**/*.ts", "bin/*.ts"],
    // ... some configs
  },
];

Strict Rules

The strict rules provide all available rules. To use these rules, configure as follows:

js
// eslint.config.mjs
import cdkPlugin from "eslint-cdk-plugin";
import tsEslint from "typescript-eslint";

export default [
  ...tsEslint.configs.recommended,
  // ✅ Add plugins
  cdkPlugin.configs.strict,
  {
    files: ["lib/**/*.ts", "bin/*.ts"],
    // ... some configs
  },
];