Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
title sidebar_label pagination_next pagination_prev slug
Overview
Overview
/

@typescript-eslint/eslint-plugin includes over 100 rules that detect best practice violations, bugs, and/or stylistic issues specifically for TypeScript code. All of our rules are listed below.

:::tip Instead of enabling rules one by one, we recommend using one of our pre-defined configs to enable a large set of recommended rules. :::

Rules

The rules are listed in alphabetical order. You can optionally filter them based on these categories:

import RulesTable from "@site/src/components/RulesTable";

Filtering

Config Group (⚙️)

"Config Group" refers to the pre-defined config that includes the rule. Extending from a configuration preset allow for enabling a large set of recommended rules all at once.

Metadata

  • 🔧 fixable refers to whether the rule contains an ESLint --fix auto-fixer.
  • 💡 has suggestions refers to whether the rule contains an ESLint suggestion fixer.
    • Sometimes, it is not safe to automatically fix the code with an auto-fixer. But in these cases, we often have a good guess of what the correct fix should be, and we can provide it as a suggestion to the developer.
  • 💭 requires type information refers to whether the rule requires typed linting.
  • 🧱 extension rule means that the rule is an extension of an core ESLint rule (see Extension Rules).
  • 📐 formatting rule means that the rule has to do with formatting.
  • 💀 deprecated rule means that the rule should no longer be used and will be removed from the plugin in a future version.

Extension Rules

Some core ESLint rules do not support TypeScript syntax: either they crash, ignore the syntax, or falsely report against it. In these cases, we create what we call an "extension rule": a rule within our plugin that has the same functionality, but also supports TypeScript.

Extension rules generally completely replace the base rule from ESLint core. If the base rule is enabled in a config you extend from, you'll need to disable the base rule:

module.exports = {
  extends: ['eslint:recommended'],
  rules: {
    // Note: you must disable the base rule as it can report incorrect errors
    'no-unused-vars': 'off',
    '@typescript-eslint/no-unused-vars': 'error',
  },
};

Search for 🧱 extension rules in this page to see all extension rules.