eslint
ESLint is the standard linting tool for JavaScript and TypeScript that analyzes your code to find and fix problems, enforce coding conventions, and catch potent…
Installation
npm install -D eslint
yarn add -D eslint
pnpm add -D eslint
Import
// eslint.config.js
Quick Example
// eslint.config.js
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
export default [
js.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'no-unused-vars': 'warn',
},
},
];About eslint
ESLint is the standard linting tool for JavaScript and TypeScript that analyzes your code to find and fix problems, enforce coding conventions, and catch potential bugs before they reach production. ESLint uses a pluggable architecture where rules are individually configurable — each rule can be turned off, set to warn, or set to error, and many rules accept additional configuration options. The tool parses source code into an AST and applies rules that check for patterns, with auto-fix capabilities for many common issues. ESLint's flat config system (eslint.config.js) provides a simpler, more powerful configuration model. The ecosystem includes thousands of rules through plugins like @typescript-eslint for TypeScript-specific rules, eslint-plugin-react for React patterns, eslint-plugin-import for module import conventions, eslint-plugin-jsx-a11y for accessibility checks, and eslint-plugin-security for security anti-patterns. ESLint integrates with all major editors for real-time feedback, with CI pipelines for enforcing standards, and with Git hooks through lint-staged and Husky for pre-commit checks. ESLint has become an indispensable part of modern JavaScript development workflows.
Quick Facts
| Package | eslint |
| Category | Build Tool |
| Weekly Downloads | 35M+ |
| License | MIT |
| Install | npm install -D eslint |
Related Packages
Prettier is an opinionated code formatter that enforces a consistent code style across your entire c…
TypeScript is a strongly typed programming language that builds on JavaScript, adding static type de…
Husky is a tool that makes Git hooks easy to use in JavaScript projects, enabling teams to enforce c…
lint-staged is a tool that runs linters and formatters on only the files that are staged in Git, mak…
Babel is the standard JavaScript compiler that transforms modern JavaScript and TypeScript syntax in…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.