Skip to content

Commit f946878

Browse files
committed
docs: improve description for use-jsx-vars rule to clarify its purpose
1 parent 241bd4b commit f946878

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/plugins/eslint-plugin-react-x/src/rules/use-jsx-vars.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ export default createRule<[], MessageID>({
1616
meta: {
1717
type: "problem",
1818
docs: {
19-
// eslint-disable-next-line eslint-plugin/require-meta-docs-description
20-
description: "a helper rule to mark variables as used",
19+
description:
20+
// eslint-disable-next-line eslint-plugin/require-meta-docs-description
21+
"helpes `eslint/no-unused-vars` to correctly mark JSX variables as used.",
2122
[Symbol.for("rule_features")]: RULE_FEATURES,
2223
},
2324
messages: {

website/pages/docs/rules/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
| [`prefer-read-only-props`](prefer-read-only-props) | 0️⃣ | `🔍` `💭` | Enforces read-only props in components. | |
6666
| [`prefer-shorthand-boolean`](prefer-shorthand-boolean) | 0️⃣ | `🔍` `🔧` | Enforces using shorthand syntax for boolean attributes. | |
6767
| [`prefer-shorthand-fragment`](prefer-shorthand-fragment) | 0️⃣ | `🔍` | Enforces using shorthand syntax for fragments. | |
68-
| [`use-jsx-vars`](use-jsx-vars) | 1️⃣ | | Helper rule to mark variables as used in JSX. | |
68+
| [`use-jsx-vars`](use-jsx-vars) | 1️⃣ | | Helpes `eslint/no-unused-vars` to correctly detect variables used in JSX. | |
6969

7070
### Deprecated
7171

website/pages/docs/rules/use-jsx-vars.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ react-x/use-jsx-vars
1919

2020
## What it does
2121

22-
Since 0.17.0 the eslint `no-unused-var`s rule does not detect variables used in JSX (see details). This rule will find variables used in JSX and mark them as used.
22+
Helpes `eslint/no-unused-vars` to correctly detect variables used in JSX.
2323

24+
Since 0.17.0 the eslint `no-unused-vars`s rule does not detect variables used in JSX (see details). This rule will find variables used in JSX and mark them as used.
2425
This rule only has an effect when the `no-unused-vars` rule is enabled.
2526

2627
## Examples

0 commit comments

Comments
 (0)