eslint
ESLint helps you enforce code quality standards across JavaScript and TypeScript projects through configurable linting rules and automated fixes. Configure rules by severity, apply shared presets for React or Node.js, and use inline comments to manage exceptions.
ESLint guides you through setting up linting rules and configurations for JavaScript and TypeScript codebases.
AI-generated summary based on this skill's SKILL.md
Install
el-feo/ai-context/eslint · repository language: Ruby
git clone https://github.com/el-feo/ai-context
cp -r ai-context/plugins/js-ts/skills/eslint ~/.claude/skills/eslintnpx skillfed install el-feo/ai-context/eslintFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do you set up ESLint for JavaScript projects?
ESLint's setup begins with installing the package and creating a configuration file (eslint.config.js or .eslintrc). ESLint lets you define rules by severity, choose presets for your environment (Node.js, browser, React), and specify your parser. The MIT-licensed tool supports both legacy and flat config formats, making it flexible for new and existing projects.
What is ESLint configuration for TypeScript and React?
ESLint configuration for TypeScript and React involves setting your parser to @typescript-eslint/parser, adding TypeScript-specific rules, and including React plugin rules. ESLint's flat config format simplifies managing multiple configurations. You can extend recommended rule sets and customize severity levels to match your project's code quality standards.
How can you fix ESLint errors automatically?
ESLint provides the --fix flag to automatically resolve violations. Run eslint --fix to apply fixes for rules that support auto-correction. ESLint handles formatting issues, unused variables, and quote consistency without manual intervention. For CI/CD pipelines, automate this step to enforce standards before code merges.
How do you configure ESLint rules and enforce code quality?
ESLint lets you configure rules by setting severity levels (off, warn, error) and rule-specific options. Use shared presets like eslint:recommended or framework-specific plugins for React and Node.js. ESLint supports inline comments to disable rules per-line, and you can create custom rules for project-specific standards.
What does the ESLint no-unused-vars warning mean?
ESLint's no-unused-vars rule flags variables declared but never used in your code. This warning helps identify dead code and reduce bundle size. ESLint lets you disable this rule inline with /* eslint-disable-next-line */ or adjust its severity in your configuration based on your project's needs.
How do you integrate ESLint into CI/CD pipelines?
ESLint integrates into CI/CD workflows like GitHub Actions by running eslint in your pipeline scripts. ESLint exits with error codes when violations are found, blocking merges until standards are met. Configure ESLint to run on staged files or entire directories, and combine it with --fix to auto-correct issues before deployment.
SKILL.md
rendered from the published skill — quoted content, verbatim
ESLint
Quick Start
Prerequisites
- Node.js (^18.18.0, ^20.9.0, or >=21.1.0) with SSL support
- Existing
package.jsonfile (runnpm initif needed)
Installation & Setup
Automated Setup (Recommended):
npm init @eslint/config@latest
This interactive setup will ask about your project and create an eslint.config.js file.
Manual Setup:
# Install ESLint packages
npm install --save-dev eslint@latest @eslint/js@latest
# Create configuration file
touch eslint.config.js
Basic Configuration
The new flat config format (ESLint 9.0+) uses eslint.config.js:
```javascript import { defineConfig } from "eslint/config"; import js from "@eslint/js";
export default defineConfig([ { files: ["*/.js"], plugins: { js },
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 8 files
plugins/js-ts/skills/eslint/SKILL.md
plugins/js-ts/skills/eslint/assets/.eslintignore.example
plugins/js-ts/skills/eslint/assets/eslint.config.examples.js
plugins/js-ts/skills/eslint/references/custom_rules.md
plugins/js-ts/skills/eslint/references/integration.md
plugins/js-ts/skills/eslint/references/migration_guide.md
plugins/js-ts/skills/eslint/references/rule_reference.md
plugins/js-ts/skills/eslint/references/type_aware_linting.md