Quick Start Guide
Get ESLint analyzing your JavaScript code in under 5 minutes. This guide will walk you through the essentials.Prerequisites
Before you begin, ensure you have Node.js installed:Required: Node.js
^20.19.0, ^22.13.0, or >=24 built with SSL support.Check your version: node --versionInstallation & Setup
Initialize ESLint Configuration
Run the interactive configuration wizard to set up ESLint for your project:This command will:
- Detect your project type (JavaScript, TypeScript, React, etc.)
- Ask about your code style preferences
- Install required dependencies
- Create an
eslint.config.jsfile
Fix Problems Automatically
Many ESLint errors can be fixed automatically. Run with the This will automatically fix:
--fix flag:- Spacing and indentation issues
- Missing semicolons
- Quote style inconsistencies
- And many other stylistic problems
Understanding the Config File
The configuration wizard creates aneslint.config.js file. Here’s what a basic config looks like:
eslint.config.js
Configuration Breakdown
files
files
Specifies which files ESLint should analyze. Supports glob patterns:This matches all
.js, .cjs, and .mjs files in any directory.rules
rules
Configures individual rules with severity levels:
"off"or0- Disable the rule"warn"or1- Show warning (exit code 0)"error"or2- Show error (exit code 1)
extends
extends
Import configurations from presets:
Common Rules to Start With
Here are some essential rules from the ESLint source code:no-unused-vars
Type: Problem
Recommended: ✓Disallow unused variables to keep your code clean.
Recommended: ✓Disallow unused variables to keep your code clean.
no-undef
Type: Problem
Recommended: ✓Disallow undefined variables to catch typos early.
Recommended: ✓Disallow undefined variables to catch typos early.
prefer-const
Type: Suggestion
Fixable: ✓Suggest using const for variables that are never reassigned.
Fixable: ✓Suggest using const for variables that are never reassigned.
no-debugger
Type: Problem
Recommended: ✓Disallow debugger statements in production code.
Recommended: ✓Disallow debugger statements in production code.
CLI Options Quick Reference
Here are the most commonly used CLI options from ESLint’s source:What’s Next?
Deep Dive into Installation
Learn about advanced installation options, pnpm setup, and TypeScript configuration
Configuration Guide
Master ESLint’s powerful configuration system
Rules Reference
Browse all 200+ built-in rules with examples
Create Custom Rules
Build your own rules to enforce project-specific patterns
Troubleshooting
ESLint is not finding my config file
ESLint is not finding my config file
Make sure your config file is named
eslint.config.js, eslint.config.mjs, or eslint.config.cjs and is in your project root.You can also specify a config file explicitly:Getting 'Parsing error' messages
Getting 'Parsing error' messages
This usually means ESLint can’t parse your JavaScript syntax. If you’re using modern syntax or TypeScript:Then update your config:
Rules are not being applied
Rules are not being applied
Check that:
- The
filespattern matches your source files - The rule is spelled correctly (e.g.,
no-unused-vars, notno-unused-variables) - Your config file is being loaded (run with
--debugflag)
Need Help?
- Join the Discord community
- Ask questions on GitHub Discussions
- Check the FAQ