Skip to content

Oxlint (oxlint-plugin-awscdk)

⚠️ Experimental

oxlint-plugin-awscdk は実験的な段階にあります。最初の安定版 (1.0.0) リリースまで、公開 API、ルールセット、プリセットの内容、設定の形は予告なく変更される可能性があります。また、まだ安定版に達していない corsa-oxlint に依存しています。

インストール

sh
npm install -D oxlint-plugin-awscdk
sh
yarn add -D oxlint-plugin-awscdk
sh
pnpm install -D oxlint-plugin-awscdk

oxlint の設定

oxlint.config.ts

ts
// oxlint.config.ts
import { defineConfig } from "oxlint";
import cdkPlugin from "oxlint-plugin-awscdk";

export default defineConfig({
  extends: [
    // ✅ Add plugins
    cdkPlugin.configs.recommended, // or cdkPlugin.configs.strict
  ],
  rules: {
    // ✅ Add rules (use custom rules)
    "awscdk/require-jsdoc": "warn",
  },
});

.oxlintrc.json

jsonc
// .oxlintrc.json
{
  // ✅ Add plugins
  "jsPlugins": ["oxlint-plugin-awscdk"],
  "rules": {
    // ✅ Add rules
    "awscdk/construct-constructor-property": "error",
    "awscdk/no-construct-in-interface": "error",
    "awscdk/no-construct-in-public-property-of-construct": "error",
    "awscdk/no-construct-stack-suffix": "error",
    "awscdk/no-mutable-property-of-props-interface": "warn",
    "awscdk/no-mutable-public-property-of-construct": "warn",
    "awscdk/no-parent-name-construct-id-match": [
      "error",
      { "disallowContainingParentName": false },
    ],
    "awscdk/no-unused-props": "error",
    "awscdk/no-variable-construct-id": "error",
    "awscdk/pascal-case-construct-id": "error",
    "awscdk/prefer-grants-property": "warn",
    "awscdk/require-passing-this": ["error", { "allowNonThisAndDisallowScope": true }],
  },
}