인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
개발 및 엔지니어링 · SKILL.md

eslint

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`

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: eslint description: | 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 allowed-tools: Read, Grep, Glob

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-biome skill for modern setup
  • TypeScript-specific rules - Use typescript-eslint skill
  • Code quality principles - Use quality-common for SOLID/Clean Code
  • SonarQube integration - Use sonarqube skill

Deep Knowledge: Use mcp__documentation__fetch_docs with technology: eslint for 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-PatternWhy It's BadCorrect Approach
Using legacy .eslintrc in new projectsDeprecated in ESLint 9Use flat config (eslint.config.mjs)
No TypeScript type checkingMisses type-aware issuesUse recommendedTypeChecked preset
Disabling rules with comments everywhereCode smell, defeats purposeFix the issue or adjust rule config
Not caching in CISlow lintingUse --cache flag
Conflicting Prettier rulesFormatting warsUse eslint-config-prettier
Ignoring warningsAccumulate tech debtTreat warnings as errors in CI

Quick Troubleshooting

IssueLikely CauseSolution
"Failed to load config" errorWrong config formatCheck eslint.config.mjs syntax
Type-aware rules not workingMissing parserOptionsAdd projectService: true to config
Linting very slowNo caching, type checking all filesEnable cache, limit type checking to TS files
Rules from plugin not foundPlugin not in flat config formatCheck plugin compatibility with ESLint 9
Prettier conflictsBoth formatting same codeAdd eslint-config-prettier last
File not being lintedIn ignores arrayCheck ignores in config
저장한 Skills