Skip to content

ESLint

87 rules eslint@10.12.0

Complete effective rule inventory.

Docs

Rules

23 rules on this page · 87 total

  • no-unsafe-optional-chaining

    Disallow use of optional chaining in contexts where the undefined value is not allowed

    : error in All ESLint contexts
    Autofix available
  • no-unused-labels

    Disallow unused labels

    : warning in All ESLint contexts
    Autofix available
  • no-unused-private-class-members

    Disallow unused private class members

    : warning in All ESLint contexts
    No autofix; suggestions available
  • no-useless-assignment

    Disallow variable assignments when the value is not used

    : warning in All ESLint contexts
    No autofix
  • no-useless-backreference

    Disallow useless backreferences in regular expressions

    : warning in All ESLint contexts
    No autofix
  • no-useless-catch

    Disallow unnecessary catch clauses

    : warning in All ESLint contexts
    No autofix
  • no-useless-computed-key

    Disallow unnecessary computed property keys in objects and classes

    : error in All ESLint contexts
    Autofix available
  • no-useless-escape

    Disallow unnecessary escape characters

    : warning in All ESLint contexts
    No autofix; suggestions available
  • no-useless-rename

    Disallow renaming import, export, and destructured assignments to the same name

    : error in All ESLint contexts
    Autofix available
  • no-useless-return

    Disallow redundant return statements

    : error in All ESLint contexts
    Autofix available
  • no-var

    Require let or const instead of var

    : error in All ESLint contexts
    Autofix available
  • no-with

    Disallow with statements

    : warning in JavaScript source, React JavaScript source
    No autofix
  • object-shorthand

    Require or disallow method and property shorthand syntax for object literals

    : error in All ESLint contexts
    Autofix available
  • prefer-arrow-callback

    Require using arrow functions for callbacks

    : error in All ESLint contexts
    Autofix available
  • prefer-const

    Require const declarations for variables that are never reassigned after declared

    : error in All ESLint contexts
    Autofix available
  • prefer-object-has-own

    Disallow use of Object.prototype.hasOwnProperty.call() and prefer use of Object.hasOwn()

    : error in All ESLint contexts
    Autofix available
  • prefer-rest-params

    Require rest parameters instead of arguments

    : error in TypeScript source, React source, TypeScript tests, Bun tests, Playwright end-to-end tests, Syntax-only tool configuration, Design-system React source
    No autofix
  • prefer-spread

    Require spread operators instead of .apply()

    : error in TypeScript source, React source, TypeScript tests, Bun tests, Playwright end-to-end tests, Syntax-only tool configuration, Design-system React source
    Autofix available
  • prefer-template

    Require template literals instead of string concatenation

    : error in All ESLint contexts
    Autofix available
  • preserve-caught-error

    Disallow losing originally caught error when re-throwing custom errors

    : warning in All ESLint contexts
    No autofix; suggestions available
  • require-yield

    Require generator functions to contain yield

    : warning in All ESLint contexts
    No autofix
  • use-isnan

    Require calls to isNaN() when checking for NaN

    : warning in All ESLint contexts
    No autofix; suggestions available
  • valid-typeof

    Enforce comparing typeof expressions against valid strings

    : warning in All ESLint contexts
    No autofix; suggestions available