🌙 Night Mode
Home β€Ί Code Formatters β€Ί ESLint Checker
πŸ” Powered by ESLint v8

ESLint Checker & Auto-Fix

Lint JavaScript and TypeScript in your browser β€” catch errors, find code quality issues, and apply ESLint's powerful auto-fix instantly. Choose from preset rule sets or configure rules individually.

Individual Rule Configuration (off / warn / error)
JavaScript / TypeScript Code
0 lines
Lint Results
πŸ” Paste code and click Lint Code or press Ctrl+Enter
πŸ”
Catch Real Errors
Identify no-unused-vars, eqeqeq, no-var, and 100+ quality issues in your JavaScript before they become bugs.
✨
Auto-Fix Support
ESLint can automatically fix many issues — missing semicolons, wrong quotes, var→const/let, trailing spaces, and more.
βš™οΈ
Custom Rule Sets
Choose Recommended, Strict (Airbnb-style), or Relaxed presets β€” or configure every rule individually to match your team's style.
πŸ”’
100% Private
ESLint runs entirely in your browser via the ESLint v8 Linter API. Your code is never sent to any server.

What Is ESLint?

ESLint is the most widely used static analysis tool for JavaScript and TypeScript. Created by Nicholas C. Zakas in 2013, it analyzes your code without executing it, finding problems that range from syntax errors to style inconsistencies and potential bugs.

Unlike Prettier (which only handles formatting), ESLint checks code quality β€” unused variables, incorrect equality checks, security issues, and much more. When combined with its auto-fix feature, it can also rewrite many problems automatically.

ESLint vs Prettier β€” Key Difference

Tool Purpose Can Auto-Fix?
ESLintCode quality & logic errorsβœ… Yes (many rules)
PrettierCode formatting onlyβœ… Yes (formatting)
Both togetherFull quality + styleβœ… Best practice

Most Important ESLint Rules

Error Prevention

  • no-unused-vars β€” Flags variables that are declared but never used
  • no-undef β€” Catches references to undeclared variables
  • no-unreachable β€” Finds code after return/throw that will never run
  • no-duplicate-case β€” Detects duplicate case labels in switch statements
  • use-before-define β€” Prevents use of variables before their declaration

Best Practices

  • eqeqeq β€” Requires === instead of == (avoids type coercion bugs)
  • no-var β€” Disallows var; use let or const instead
  • prefer-const β€” Suggests const when a variable is never reassigned
  • no-eval β€” Disallows dangerous eval() calls
  • no-implicit-globals β€” Prevents accidentally creating global variables
  • no-console β€” Warns about console.log() left in production code
  • no-debugger β€” Prevents debugger statements in production

Code Style (Auto-fixable)

  • semi β€” Enforce or disallow semicolons
  • quotes β€” Enforce single, double, or backtick quotes
  • indent β€” Consistent indentation (2 or 4 spaces, or tabs)
  • comma-dangle β€” Trailing commas in multiline expressions
  • no-trailing-spaces β€” Remove trailing whitespace from lines
  • no-multiple-empty-lines β€” Limit consecutive blank lines
  • arrow-spacing β€” Spaces around fat-arrow =>
  • object-curly-spacing β€” Spaces inside { } object literals

Setting Up ESLint in Your Project

# Install
npm install --save-dev eslint

# Initialise config (interactive)
npx eslint --init

# Lint a file
npx eslint src/index.js

# Lint and auto-fix
npx eslint src/index.js --fix

# Lint entire project
npx eslint . --ext .js,.jsx,.ts,.tsx

Example .eslintrc.json

{
  "env": { "browser": true, "es2022": true, "node": true },
  "extends": ["eslint:recommended"],
  "parserOptions": { "ecmaVersion": "latest", "sourceType": "module" },
  "rules": {
    "no-unused-vars": "error",
    "no-console": "warn",
    "eqeqeq": ["error", "always"],
    "semi": ["error", "always"],
    "quotes": ["warn", "single"],
    "no-var": "error",
    "prefer-const": "warn"
  }
}

ESLint with TypeScript

For TypeScript projects, install @typescript-eslint/parser and @typescript-eslint/eslint-plugin:

npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin

# .eslintrc.json for TypeScript
{
  "parser": "@typescript-eslint/parser",
  "plugins": ["@typescript-eslint"],
  "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"]
}

Integrating ESLint in Your Workflow

  • VS Code: Install the ESLint extension β€” errors appear inline as you type
  • Pre-commit hooks: Use lint-staged + husky to lint before every commit
  • CI/CD: Run npx eslint . --max-warnings 0 to fail builds with any warnings
  • Vite/Webpack: Use vite-plugin-eslint or eslint-webpack-plugin for build-time linting