eslint-setup
/eslint-setup
ESLintセットアップスキル。coding-standardsに対応するESLint公式ルールをプロジェクトに導入する。「ESLint設定」「リンター設定」「eslint setup」などのリクエスト時に使用。
- Author
- DIO0550 ↗
- Repository
- d-market-typescript ↗
- Licence
- MIT
- Last repository change
- 06.08.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 06.08.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
ESLintセットアップスキル。coding-standardsに対応するESLint公式ルールをプロジェクトに導入する。「ESLint設定」「リンター設定」「eslint setup」などのリクエスト時に使用。
Original author description
ESLintセットアップスキル。coding-standardsに対応するESLint公式ルールをプロジェクトに導入する。「ESLint設定」「リンター設定」「eslint setup」などのリクエスト時に使用。
How it works
- 制約
- 対応ルール一覧
- 実行手順
SKILL.md preview
---
name: eslint-setup
description: ESLintセットアップスキル。coding-standardsに対応するESLint公式ルールをプロジェクトに導入する。「ESLint設定」「リンター設定」「eslint setup」などのリクエスト時に使用。
disable-model-invocation: true
---
# ESLint セットアップスキル
coding-standardsのルールに対応するESLint公式ルール(ESLint core + @typescript-eslint)をプロジェクトに導入する。
## 制約
- ESLint core と `@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 が必要で設定が追加で必要になる
## 実行手順
### 1. 既存設定の確認
プロジェクトルートで以下を確認する。
- `eslint.config.*` (flat config) の有無
- `.eslintrc.*` (legacy config) の有無
- `package.json` 内の `eslint` / `@typescript-eslint/*` の有無
### 2. ルール選択
対応ルール一覧をユーザーに提示し、以下を確認する。
- ON/OFF の変更があるか
- `max-depth` の値(デフォルト: 4)
- `no-magic-numbers` の `ignore` に追加したい値(デフォルト: `[0, 1, -1]`)
- `explicit-function-return-type` を有効にする場合、`allowExpressions` を true にするか
### 3. ESLint がインストールされていない場合
必要パッケージをユーザーに提示し、確認を得てからインストールする。
```
eslint
@typescript-eslint/parser
@typescript-eslint/eslint-plugin
typescript-eslint
```
### 4. 設定ファイルの生成
#### 既存の設定ファイルがある場合
既存ファイルにルールを追記する(従来通り)。
#### 新規作成の場合
2つのファイルを生成する。ルール定義を `{プロジェクトルート}/.plugin-workspace/linting/eslint-rules.mjs` に配置し、プロジェクトルートにはそこからインポートするプロキシを置く。`.plugin-workspace/linting/` ディレクトリがなければ作成する。
**`{プロジェクトルート}/.plugin-workspace/linting/eslint-rules.mjs`**(ルール定義 — ソースオブトゥルース):
```javascript
export const pluginRules = {
// ユーザーが選択したルールをここに記載
};
```
**`eslint.config.mjs`**(プロジェクトルート — プロキシ):
```javascript
import tseslint from "typescript-eslint";
import { pluginRules } from "./.plugin-workspace/linting/eslint-rules.mjs";
export default tseslint.config(
...tseslint.configs.recommended,
{ rules: pluginRules },
);
```
`prefer-readonly` を有効にする場合は `parserOptions.project` の設定が必要であることをユーザーに伝える。
### 5. ユーザーへの確認
生成する設定ファイルの内容をユーザーに提示し、承認を得てから書き込む。
### 6. 動作確認
設定ファイル書き込み後、`npx eslint --max-warnings=0 .` を実行して動作を確認する。エラーが多すぎる場合はユーザーと相談して対応を決める。
### 7. 完了報告
有効にしたルール一覧を報告する。
Versions
The database has no other skills named eslint-setup.
Database snapshot: 13.11.2026 · package version 0c0076e451f1 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100typescript-eslint
typescript-eslint - ESLint plugin for TypeScript USE WHEN: user mentions "typescript-eslint", "TypeScript linting", "type-aware rules", asks about "no-floating-promises", "TypeScript ESLint config", "@typescript-eslint rules" DO NOT USE FOR: ESLint 9 full setup - use… - 100eslint-configuration
Use when eSLint configuration including config files, extends, plugins, and environment setup. - 100eslint-rules
Use when eSLint built-in rules including rule configuration, severity levels, and disabling strategies. - 100eslint
Expert ESLint assistance covering Flat Config (eslint.config.js), typescript-eslint, custom rules, and automated formatting. Use when enforcing code quality and preventing bugs in JavaScript/TypeScript. - 100eslint-plugin-custom-rule
USE THIS when asked to create a new eslint plugin rule for the eslint-plugin-cds package - 100eslint-fix
安全诊断并修复 ESLint error、warning 和配置兼容问题。用于用户要求运行 lint、解释 ESLint 报错、限定范围自动修复或迁移 ESLint 配置时;优先使用项目锁定的包管理器与版本,先预检再修改,不自动下载最新版或批量改写无关源码。