You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/README.md
+44-7Lines changed: 44 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,55 @@ pagination_prev: null
6
6
slug: /
7
7
---
8
8
9
-
`@typescript-eslint/eslint-plugin` includes over 100 rules that detect best practice violations, bugs, and/or stylistic issues specifically for TypeScript code.
10
-
See [Configs](/linting/configs) for how to enable recommended rules using configs.
9
+
`@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.
11
10
12
-
## Supported Rules
11
+
:::tip
12
+
Instead of enabling rules one by one, we recommend using one of [our pre-defined configs](/linting/configs) to enable a large set of recommended rules.
13
+
:::
14
+
15
+
## Rules
16
+
17
+
The rules are listed in alphabetical order. You can optionally filter them based on these categories:
13
18
14
19
import RulesTable from "@site/src/components/RulesTable";
15
20
16
-
<RulesTableruleset="supported-rules" />
21
+
<RulesTable />
22
+
23
+
## Filtering
24
+
25
+
### Config Group (⚙️)
26
+
27
+
"Config Group" refers to the [pre-defined config](/linting/configs) that includes the rule. Extending from a configuration preset allow for enabling a large set of recommended rules all at once.
28
+
29
+
### Metadata
30
+
31
+
-`🔧 fixable` refers to whether the rule contains an [ESLint `--fix` auto-fixer](https://eslint.org/docs/latest/use/command-line-interface#--fix).
32
+
-`💡 has suggestions` refers to whether the rule contains an ESLint suggestion fixer.
33
+
- 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.
34
+
-`💭 requires type information` refers to whether the rule requires [typed linting](/linting/typed-linting).
35
+
-`🧱 extension rule` means that the rule is an extension of an [core ESLint rule](https://eslint.org/docs/latest/rules) (see [Extension Rules](#extension-rules)).
36
+
-`📐 formatting rule` means that the rule has to do with formatting.
37
+
- We [strongly recommend against using ESLint for formatting](/linting/troubleshooting/formatting).
38
+
- Soon, formatting rules will be moved to the [ESLint stylistic plugin](https://eslint.style).
39
+
-`💀 deprecated rule` means that the rule should no longer be used and will be removed from the plugin in a future version.
17
40
18
41
## Extension Rules
19
42
20
-
In some cases, ESLint provides a rule itself, but it doesn't support TypeScript syntax; either it crashes, or it ignores the syntax, or it falsely reports against it.
21
-
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.
43
+
Some core ESLint rules do not support TypeScript syntax: either they crash, ignore the syntax, or falsely report against it.
44
+
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.
45
+
46
+
Extension rules generally completely replace the base rule from ESLint core.
47
+
If the base rule is enabled in a config you extend from, you'll need to disable the base rule:
48
+
49
+
```js
50
+
module.exports= {
51
+
extends: ['eslint:recommended'],
52
+
rules: {
53
+
// Note: you must disable the base rule as it can report incorrect errors
54
+
'no-unused-vars':'off',
55
+
'@typescript-eslint/no-unused-vars':'error',
56
+
},
57
+
};
58
+
```
22
59
23
-
<RulesTableruleset="extension-rules" />
60
+
[Search for `🧱 extension rule`s](?=extension#rules) in this page to see all extension rules.
0 commit comments