---
packages/website/src/components/RulesTable/index.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx
index e377c68aae81..4801efd8108b 100644
--- a/packages/website/src/components/RulesTable/index.tsx
+++ b/packages/website/src/components/RulesTable/index.tsx
@@ -80,7 +80,7 @@ function RuleRow({
: undefined
}
>
- {fixable ? `${FIXABLE_EMOJI}\n` : '\n'}
+ {fixable ? FIXABLE_EMOJI : ''}
{hasSuggestions ? SUGGESTIONS_EMOJI : ''}
Date: Fri, 13 Oct 2023 15:16:28 -0400
Subject: [PATCH 10/19] fix: sort --> filter
---
packages/eslint-plugin/docs/rules/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md
index aef6317b733b..15a66b6b6c57 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -12,13 +12,13 @@ Instead of enabling rules one by one, we recommend using one of [our pre-defined
## Rules
-The rules are listed in alphabetical order. You can optionally sort them based on these categories:
+The rules are listed in alphabetical order. You can optionally filter them based on these categories:
import RulesTable from "@site/src/components/RulesTable";
-## Sorting
+## Filtering
- "Config Group" refers to the configuration preset. We offer [three different config groups](/linting/configs) that allow users to enable a large set of recommended rules all at once.
- `🔧 fixable` refers to whether the rule contains an ESLint auto-fixer. If the rule has an auto-fixer, then some rule violations can be fixed by running `eslint` with the `--fix` flag. This will automatically change the code, which can save a lot of time! (It is a common pattern for developers to configure their IDE to automatically run `eslint --fix` when saving a TypeScript file.)
From fefe2eb316caf8aaff72f680a04f30233674e2de Mon Sep 17 00:00:00 2001
From: James <5511220+Zamiell@users.noreply.github.com>
Date: Fri, 13 Oct 2023 15:17:15 -0400
Subject: [PATCH 11/19] fix: sort --> filter
---
packages/website/src/components/RulesTable/index.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx
index 4801efd8108b..0dc92fc86346 100644
--- a/packages/website/src/components/RulesTable/index.tsx
+++ b/packages/website/src/components/RulesTable/index.tsx
@@ -250,7 +250,7 @@ export default function RulesTable(): React.JSX.Element {
(These categories are explained in{' '}
- more detail below.)
+ more detail below.)
From 868ea0b6cbb27925ef342101c0fffa59c741ed50 Mon Sep 17 00:00:00 2001
From: James <5511220+Zamiell@users.noreply.github.com>
Date: Sun, 15 Oct 2023 15:10:29 -0400
Subject: [PATCH 12/19] Update packages/eslint-plugin/docs/rules/README.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Josh Goldberg ✨
---
packages/eslint-plugin/docs/rules/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md
index 15a66b6b6c57..cace722dfa36 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -8,7 +8,7 @@ slug: /
`@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.
-Instead of enabling rules one by one, we recommend using one of [our pre-defined configs](/linting/configs) to easily enable a large set of recommended rules.
+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.
## Rules
From a3457e3a848951dac105979bf43fc74fae15d47d Mon Sep 17 00:00:00 2001
From: James <5511220+Zamiell@users.noreply.github.com>
Date: Sun, 15 Oct 2023 15:15:40 -0400
Subject: [PATCH 13/19] feat: adding tip
---
packages/eslint-plugin/docs/rules/README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md
index cace722dfa36..37ec61bfa936 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -8,7 +8,9 @@ slug: /
`@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](/linting/configs) to enable a large set of recommended rules.
+:::
## Rules
From ca9e428ce43c3981a0b2a9062beaec4d5236f8f5 Mon Sep 17 00:00:00 2001
From: James <5511220+Zamiell@users.noreply.github.com>
Date: Sun, 15 Oct 2023 15:17:34 -0400
Subject: [PATCH 14/19] feat: config emoji
---
packages/website/src/components/RulesTable/index.tsx | 5 +++--
packages/website/src/components/constants.ts | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx
index 0dc92fc86346..f15bdcfe79bc 100644
--- a/packages/website/src/components/RulesTable/index.tsx
+++ b/packages/website/src/components/RulesTable/index.tsx
@@ -10,6 +10,7 @@ import {
useHistorySelector,
} from '../../hooks/useHistorySelector';
import {
+ CONFIG_EMOJI,
DEPRECATED_RULE_EMOJI,
EXTENSION_RULE_EMOJI,
FIXABLE_EMOJI,
@@ -192,7 +193,7 @@ export default function RulesTable(): React.JSX.Element {
return (
<>
- Config Group
+ Config Group ({CONFIG_EMOJI})
Rule
- ⚙️ {/* We use a gear to represent "Config". */}
+ {CONFIG_EMOJI}
|
diff --git a/packages/website/src/components/constants.ts b/packages/website/src/components/constants.ts
index 82bdba24715b..ec55bfa14585 100644
--- a/packages/website/src/components/constants.ts
+++ b/packages/website/src/components/constants.ts
@@ -1,3 +1,5 @@
+export const CONFIG_EMOJI = '⚙️';
+
export const RECOMMENDED_CONFIG_EMOJI = '✅';
export const STRICT_CONFIG_EMOJI = '🔒';
export const STYLISTIC_CONFIG_EMOJI = '🎨';
From e643ed523048573b3e3f9d96f3c60f3baf0f69bd Mon Sep 17 00:00:00 2001
From: James <5511220+Zamiell@users.noreply.github.com>
Date: Sun, 15 Oct 2023 15:21:12 -0400
Subject: [PATCH 15/19] feat: shorten filtering docs
---
packages/eslint-plugin/docs/rules/README.md | 22 +++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md
index 37ec61bfa936..01ea7f19f849 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -22,10 +22,20 @@ import RulesTable from "@site/src/components/RulesTable";
## Filtering
-- "Config Group" refers to the configuration preset. We offer [three different config groups](/linting/configs) that allow users to enable a large set of recommended rules all at once.
-- `🔧 fixable` refers to whether the rule contains an ESLint auto-fixer. If the rule has an auto-fixer, then some rule violations can be fixed by running `eslint` with the `--fix` flag. This will automatically change the code, which can save a lot of time! (It is a common pattern for developers to configure their IDE to automatically run `eslint --fix` when saving a TypeScript file.)
-- `💡 has suggestions` refers to whether the rule will offer a suggestion of how to fix the code. 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 needs to leverage the power of the TypeScript compiler in order to work properly. Rules that require type information are usually much slower than rules that don't. Thus, if linting performance becomes an issue in a gigantic codebase, a good first step might be make rules that require type information run only in CI.
-- `🧱 extension rule` means that the rule was originally a [core ESLint rule](https://eslint.org/docs/latest/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 an "extension rule": a rule within our plugin that has the same functionality, but also supports TypeScript.
-- `📐 formatting rule` means that the rule has to do with formatting. Formatting rules are mostly here for legacy purposes, because we [strongly recommend against using ESLint for formatting](/linting/troubleshooting/formatting).
+### Config Group (⚙️)
+
+"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.
+
+### Metadata
+
+- `🔧 fixable` refers to whether the rule contains an [ESLint `--fix` auto-fixer](https://eslint.org/docs/latest/use/command-line-interface#--fix).
+- `💡 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](/linting/typed-linting).
+- `🧱 extension rule` means that the rule was originally a [core ESLint rule](https://eslint.org/docs/latest/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 an "extension rule": a rule within our plugin that has the same functionality, but also supports TypeScript.
+- `📐 formatting rule` means that the rule has to do with formatting.
+ - We [strongly recommend against using ESLint for formatting](/linting/troubleshooting/formatting).
+ - Soon, formatting rules will be moved to the [ESLint stylistic plugin](https://eslint.style).
- `💀 deprecated rule` means that the rule should no longer be used and will be removed from the plugin in a future version.
From 3d890b434a9fc5b2a3f370e1de0f4cfc33d80c33 Mon Sep 17 00:00:00 2001
From: Josh Goldberg
Date: Tue, 17 Oct 2023 22:29:52 -0400
Subject: [PATCH 16/19] yarn format
---
packages/website/src/components/RulesTable/index.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx
index f15bdcfe79bc..b4c1823b8c32 100644
--- a/packages/website/src/components/RulesTable/index.tsx
+++ b/packages/website/src/components/RulesTable/index.tsx
@@ -81,7 +81,8 @@ function RuleRow({
: undefined
}
>
- {fixable ? FIXABLE_EMOJI : ''}
+ {fixable ? FIXABLE_EMOJI : ''}
+
{hasSuggestions ? SUGGESTIONS_EMOJI : ''}
Date: Wed, 18 Oct 2023 09:31:32 -0400
Subject: [PATCH 17/19] Added explicit Extension Rules heading
---
packages/eslint-plugin/docs/rules/README.md | 25 ++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md
index 01ea7f19f849..4b6f9df42dc9 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -32,10 +32,29 @@ import RulesTable from "@site/src/components/RulesTable";
- `💡 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](/linting/typed-linting).
-- `🧱 extension rule` means that the rule was originally a [core ESLint rule](https://eslint.org/docs/latest/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 an "extension rule": a rule within our plugin that has the same functionality, but also supports TypeScript.
+- `🧱 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)).
- `📐 formatting rule` means that the rule has to do with formatting.
- We [strongly recommend against using ESLint for formatting](/linting/troubleshooting/formatting).
- Soon, formatting rules will be moved to the [ESLint stylistic plugin](https://eslint.style).
- `💀 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:
+
+```js
+module.exports = {
+ extends: ['eslint:recommended'],
+ rules: {
+ // Note: you must disable the base rule as it can report incorrect errors
+ 'class-methods-use-this': 'off',
+ '@typescript-eslint/class-methods-use-this': 'error',
+ },
+};
+```
+
+[Search for `🧱 extension rule`s](?=extension#rules) in this page to see all extension rules.
From 0b64bad89217e5fc1f31679d912114578bac8291 Mon Sep 17 00:00:00 2001
From: Josh Goldberg
Date: Wed, 18 Oct 2023 09:59:01 -0400
Subject: [PATCH 18/19] class-methods-use-this isn't actually in
eslint:recommended
---
packages/eslint-plugin/docs/rules/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md
index 4b6f9df42dc9..4d76d15d4f67 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -51,8 +51,8 @@ module.exports = {
extends: ['eslint:recommended'],
rules: {
// Note: you must disable the base rule as it can report incorrect errors
- 'class-methods-use-this': 'off',
- '@typescript-eslint/class-methods-use-this': 'error',
+ 'dot-notation': 'off',
+ '@typescript-eslint/dot-notation': 'error',
},
};
```
From 49ec74582ac626f50c864bcc52225dac9bea0430 Mon Sep 17 00:00:00 2001
From: Josh Goldberg
Date: Wed, 18 Oct 2023 10:03:44 -0400
Subject: [PATCH 19/19] no-unused-vars actually
---
packages/eslint-plugin/docs/rules/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md
index 4d76d15d4f67..7b4d4dde58ed 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -51,8 +51,8 @@ module.exports = {
extends: ['eslint:recommended'],
rules: {
// Note: you must disable the base rule as it can report incorrect errors
- 'dot-notation': 'off',
- '@typescript-eslint/dot-notation': 'error',
+ 'no-unused-vars': 'off',
+ '@typescript-eslint/no-unused-vars': 'error',
},
};
```
| | |