typescript-eslint
БесплатноБез исполняемых скриптовНе проверенtypescript-eslint - ESLint plugin for TypeScript USE WHEN: user mentions "typescript-eslint", "TypeScript linting", "type-aware rules", asks about…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
typescript-eslint - Quick Reference
When to Use This Skill
- Configure ESLint for TypeScript projects
- Type-aware rules for TypeScript
- Migration from TSLint
When NOT to Use This Skill
- Full ESLint 9 setup - Use
eslint-biomeskill for complete configuration - Biome linter - Use
eslint-biomeskill for Biome setup - Code quality principles - Use
quality-commonfor SOLID/Clean Code - Java/Kotlin - Use
sonarqubeskill for JVM languages
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:typescript-eslintfor comprehensive documentation.
Basic Setup
npm install -D eslint typescript-eslint
Flat Config (ESLint 9+)
eslint.config.mjs
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
);
Type-Aware Linting
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
);
Strict Configuration
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
);
Common Rules
{
rules: {
// Prevent unused variables
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_'
}],
// Require explicit return types
'@typescript-eslint/explicit-function-return-type': 'warn',
// Prevent any usage
'@typescript-eslint/no-explicit-any': 'error',
// Require await in async functions
'@typescript-eslint/require-await': 'error',
// Prevent floating promises
'@typescript-eslint/no-floating-promises': 'error',
// Consistent type imports
'@typescript-eslint/consistent-type-imports': 'error',
}
}
File-Specific Rules
export default tseslint.config(
// ... base config
{
files: ['**/*.test.ts', '**/*.spec.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked,
},
);
Anti-Patterns
| Anti-Pattern | Why It's Bad | Correct Approach |
|---|---|---|
| Not using type-aware rules | Misses Promise, async issues | Use recommendedTypeChecked |
Allowing any everywhere |
Defeats TypeScript purpose | Set no-explicit-any: error |
No require-await rule |
Unnecessary async keywords | Enable type-aware async rules |
| Type checking JS files | JS has no types | Use disableTypeChecked for .js |
| Disabling rules in test files | Tests need quality too | Only disable no-explicit-any if needed |
| Ignoring unused variables | Code smell, unused imports | Use no-unused-vars with ignore pattern |
Quick Troubleshooting
| Issue | Likely Cause | Solution |
|---|---|---|
| Type-aware rules not working | Missing projectService: true |
Add to languageOptions.parserOptions |
| Linting very slow | Type checking all files | Limit type rules to **/*.ts only |
| "Unsafe" errors everywhere | Strict type checking | Use strictTypeChecked or disable specific rules |
| Promise errors not caught | Missing no-floating-promises |
Enable in recommendedTypeChecked preset |
| Unused imports not detected | Wrong rule configuration | Use @typescript-eslint/no-unused-vars |
| Rules conflict with Prettier | Both formatting code | Add eslint-config-prettier last |
Установить typescript-eslint в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobFAQ
Что делает скилл typescript-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 `eslint-biome` skill, Biome - use `eslint-biome`, general quality - use `quality-common`
Как установить скилл typescript-eslint?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл typescript-eslint запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic