eslint
БесплатноБез исполняемых скриптовНе проверенESLint - pluggable JavaScript/TypeScript linter USE WHEN: user mentions "ESLint", "JavaScript linting", ".eslintrc", asks about "eslint config", "linting…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
ESLint - Quick Reference
When to Use This Skill
- Configure linting for JavaScript/TypeScript projects
- Create custom rules
- Integrate with Prettier and other tools
When NOT to Use This Skill
- ESLint 9 flat config + Biome - Use
eslint-biomeskill for modern setup - TypeScript-specific rules - Use
typescript-eslintskill - Code quality principles - Use
quality-commonfor SOLID/Clean Code - SonarQube integration - Use
sonarqubeskill
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:eslintfor comprehensive documentation.
Basic Setup
npm install -D eslint @eslint/js
npx eslint --init
Flat Config (ESLint 9+)
eslint.config.js
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
export default [
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/explicit-function-return-type': 'warn',
},
},
{
ignores: ['dist/', 'node_modules/', '*.config.js'],
},
];
With Prettier
import eslintConfigPrettier from 'eslint-config-prettier';
export default [
js.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier, // Must be last
];
Legacy Config (.eslintrc)
{
"root": true,
"env": { "browser": true, "es2021": true, "node": true },
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"no-console": "warn",
"@typescript-eslint/no-explicit-any": "error"
}
}
CLI Usage
# Lint files
npx eslint src/
# Fix auto-fixable issues
npx eslint src/ --fix
# Check specific files
npx eslint "src/**/*.{ts,tsx}"
Anti-Patterns
| Anti-Pattern | Why It's Bad | Correct Approach |
|---|---|---|
| Using legacy .eslintrc in new projects | Deprecated in ESLint 9 | Use flat config (eslint.config.mjs) |
| No TypeScript type checking | Misses type-aware issues | Use recommendedTypeChecked preset |
| Disabling rules with comments everywhere | Code smell, defeats purpose | Fix the issue or adjust rule config |
| Not caching in CI | Slow linting | Use --cache flag |
| Conflicting Prettier rules | Formatting wars | Use eslint-config-prettier |
| Ignoring warnings | Accumulate tech debt | Treat warnings as errors in CI |
Quick Troubleshooting
| Issue | Likely Cause | Solution |
|---|---|---|
| "Failed to load config" error | Wrong config format | Check eslint.config.mjs syntax |
| Type-aware rules not working | Missing parserOptions | Add projectService: true to config |
| Linting very slow | No caching, type checking all files | Enable cache, limit type checking to TS files |
| Rules from plugin not found | Plugin not in flat config format | Check plugin compatibility with ESLint 9 |
| Prettier conflicts | Both formatting same code | Add eslint-config-prettier last |
| File not being linted | In ignores array | Check ignores in config |
Установить eslint в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobFAQ
Что делает скилл eslint?
ESLint - pluggable JavaScript/TypeScript linter USE WHEN: user mentions "ESLint", "JavaScript linting", ".eslintrc", asks about "eslint config", "linting rules", "eslint plugins", "flat config" DO NOT USE FOR: Biome - use `eslint-biome` skill, TypeScript-specific - use `typescript-eslint` skill, code quality principles - use `quality-common`
Как установить скилл eslint?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл eslint запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic