ESLint
Find and fix problems in your JavaScript code automatically.
Overview
ESLint is a pluggable linting tool for JavaScript and TypeScript. It analyses code without running it and reports mistakes, risky patterns and style inconsistencies, and can automatically fix many of them.
Using ESLint in your editor and in your build pipeline keeps a team's code consistent and prevents common bugs.
Where it is used
- Front-end and Node.js projects
- Team coding standards
- Pre-commit and pipeline checks
- Learning good JavaScript practices
Add ESLint to a project
npm init @eslint/config@latest
npx eslint .
npx eslint . --fix
What you will cover
The key topics and features of ESLint
Find Problems
Catch undefined variables, unreachable code and more.
Auto-Fix
Fix many issues with a single command.
Configurable Rules
Turn rules on or off and set their severity.
Plugins & Shared Configs
React, Vue, TypeScript and many others.
Editor Integration
Warnings appear as you type in VS Code and other editors.
CI Integration
Fail builds on lint errors.