Skip to content

typescript-eslint

104 rules typescript-eslint@8.71.2

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 104 total

  • @typescript-eslint/no-unsafe-function-type

    Disallow using the unsafe built-in Function type

    : error in All typescript-eslint contexts
    No autofix
  • @typescript-eslint/no-unsafe-member-access

    Disallow member access on a value with type any

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, Design-system React source
    No autofix
  • @typescript-eslint/no-unsafe-return

    Disallow returning a value with type any from a function

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix
  • @typescript-eslint/no-unsafe-type-assertion

    Disallow type assertions that narrow a type

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, Design-system React source
    No autofix
  • @typescript-eslint/no-unsafe-unary-minus

    Require unary negation to take a number

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix
  • @typescript-eslint/no-unused-expressions

    Disallow unused expressions

    : error in All typescript-eslint contexts
    No autofix
  • @typescript-eslint/no-unused-vars

    Disallow unused variables

    : error in All typescript-eslint contexts
    Autofix available; suggestions available
  • @typescript-eslint/no-useless-constructor

    Disallow unnecessary constructors

    : error in All typescript-eslint contexts
    No autofix; suggestions available
  • @typescript-eslint/no-useless-default-assignment

    Disallow default values that will never be used

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix; suggestions available
  • @typescript-eslint/no-useless-empty-export

    Disallow empty exports that don't change anything in a module file

    : error in All typescript-eslint contexts
    Autofix available
  • @typescript-eslint/no-wrapper-object-types

    Disallow using confusing built-in primitive class wrappers

    : error in All typescript-eslint contexts
    Autofix available
  • @typescript-eslint/non-nullable-type-assertion-style

    Enforce non-null assertions over explicit type assertions

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    Autofix available
  • @typescript-eslint/only-throw-error

    Disallow throwing non-Error values as exceptions

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix
  • @typescript-eslint/prefer-as-const

    Enforce the use of as const over literal type

    : error in All typescript-eslint contexts
    Autofix available; suggestions available
  • @typescript-eslint/prefer-find

    Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix; suggestions available
  • @typescript-eslint/prefer-for-of

    Enforce the use of for-of loop over the standard for loop where possible

    : error in All typescript-eslint contexts
    No autofix
  • @typescript-eslint/prefer-function-type

    Enforce using function types instead of interfaces with call signatures

    : error in All typescript-eslint contexts
    Autofix available
  • @typescript-eslint/prefer-includes

    Enforce includes method over indexOf method

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    Autofix available
  • @typescript-eslint/prefer-literal-enum-member

    Require all enum members to be literal values

    : error in All typescript-eslint contexts
    No autofix
  • @typescript-eslint/prefer-namespace-keyword

    Require using namespace keyword over module keyword to declare custom TypeScript modules

    : error in All typescript-eslint contexts
    Autofix available
  • @typescript-eslint/prefer-nullish-coalescing

    Enforce using the nullish coalescing operator instead of logical assignments or chaining

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix; suggestions available
  • @typescript-eslint/prefer-optional-chain

    Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    Autofix available; suggestions available
  • @typescript-eslint/prefer-promise-reject-errors

    Require using Error objects as Promise rejection reasons

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix
  • @typescript-eslint/prefer-readonly

    Require private members to be marked as readonly if they're never modified outside of the constructor

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    Autofix available
  • @typescript-eslint/prefer-reduce-type-parameter

    Enforce using type parameter when calling Array#reduce instead of using a type assertion

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    Autofix available
  • @typescript-eslint/prefer-regexp-exec

    Enforce RegExp#exec over String#match if no global flag is provided

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    Autofix available
  • @typescript-eslint/prefer-return-this-type

    Enforce that this is used when only this type is returned

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    Autofix available
  • @typescript-eslint/prefer-string-starts-ends-with

    Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    Autofix available
  • @typescript-eslint/related-getter-setter-pairs

    Enforce that get() types should be assignable to their equivalent set() type

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix
  • @typescript-eslint/require-array-sort-compare

    Require Array#sort and Array#toSorted calls to always provide a compareFunction

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix
  • @typescript-eslint/require-await

    Disallow async functions which do not return promises and have no await expression

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, Design-system React source
    No autofix; suggestions available
  • @typescript-eslint/restrict-plus-operands

    Require both operands of addition to be the same type and be bigint, number, or string

    : error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source
    No autofix