ESLintセットアップスキル。coding-standardsに対応するESLint公式ルールをプロジェクトに導入する。「ESLint設定」「リンター設定」「eslint setup」などのリクエスト時に使用。
How this skill is triggered — by the user, by Claude, or both
Slash command
/typescript-rules-plugin:eslint-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
coding-standardsのルールに対応するESLint公式ルール(ESLint core + @typescript-eslint)をプロジェクトに導入する。
coding-standardsのルールに対応するESLint公式ルール(ESLint core + @typescript-eslint)をプロジェクトに導入する。
@typescript-eslint のみ使用する以下の表をユーザーに提示し、導入するルールを選択してもらう。
| # | coding-standards のルール | ESLint ルール | デフォルト |
|---|---|---|---|
| 1 | if文に波括弧必須 | curly | ON |
| 2 | マジックナンバー禁止 | no-magic-numbers | ON |
| 3 | any 禁止 | @typescript-eslint/no-explicit-any | ON |
| 4 | 返り値の型明示 | @typescript-eslint/explicit-function-return-type | OFF |
| 5 | const 優先 | prefer-const | ON |
| 6 | ネスト深さ制限 | max-depth | ON |
| 7 | readonly 優先 | @typescript-eslint/prefer-readonly | OFF |
デフォルト OFF の理由:
explicit-function-return-type: 既存コードへの影響が大きい場合があるprefer-readonly: type checker が必要で設定が追加で必要になるプロジェクトルートで以下を確認する。
eslint.config.* (flat config) の有無.eslintrc.* (legacy config) の有無package.json 内の eslint / @typescript-eslint/* の有無対応ルール一覧をユーザーに提示し、以下を確認する。
max-depth の値(デフォルト: 4)no-magic-numbers の ignore に追加したい値(デフォルト: [0, 1, -1])explicit-function-return-type を有効にする場合、allowExpressions を true にするか必要パッケージをユーザーに提示し、確認を得てからインストールする。
eslint
@typescript-eslint/parser
@typescript-eslint/eslint-plugin
typescript-eslint
既存の設定ファイルがある場合はルールを追記、ない場合は flat config (eslint.config.mjs) を新規作成する。
生成する設定の基本形:
import tseslint from "typescript-eslint";
export default tseslint.config(
...tseslint.configs.recommended,
{
rules: {
// ユーザーが選択したルールをここに記載
},
}
);
prefer-readonly を有効にする場合は parserOptions.project の設定が必要であることをユーザーに伝える。
生成する設定ファイルの内容をユーザーに提示し、承認を得てから書き込む。
設定ファイル書き込み後、npx eslint --max-warnings=0 . を実行して動作を確認する。エラーが多すぎる場合はユーザーと相談して対応を決める。
有効にしたルール一覧を報告する。
npx claudepluginhub dio0550/d-market-typescript --plugin typescript-rules-pluginSets up and configures ESLint for JavaScript/TypeScript projects including React and Node.js, analyzes code for issues, fixes linting violations.
Configures ESLint setups including config files, extends, plugins, and environment settings for JavaScript/TypeScript projects. Use for linting and code quality tasks.
Sets up strict ESLint config for TypeScript projects and systematically fixes all linting issues via auto-fix and manual remediation.