Skip to content

Commit 6f72e99

Browse files
committed
Update rule descriptions and markdown print width
This commit improves the clarity of rule descriptions, particularly for `no-unused-props` and `no-unnecessary-key`. It also reduces the markdown line width to 120 characters for better readability.
1 parent 0471eb3 commit 6f72e99

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.mdxlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"rule": "-",
44
"bullet": "-",
55
"emphasis": "_",
6-
"printWidth": 1024
6+
"printWidth": 120
77
},
88
"plugins": ["remark-gfm", ["remark-frontmatter", ["toml", "yaml"]]]
99
}

apps/website/content/docs/release-notes/v2.0.0.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ We have refactored our rules to make them more consistent and intuitive.
4242
This release adds several new rules to help you write cleaner and more robust React code.
4343

4444
- **`react-x/no-unused-props`**: A TSC-backed rule to flag component props that are defined but never used (credit to [@ulrichstark](https://github.com/ulrichstark) for the implementation).
45-
- **`react-x/no-unnecessary-key`**: Flags unnecessary `key` props on elements that are not part of a list rendering (credit to [@kachkaev](https://github.com/kachkaev) for the idea).
45+
- **`react-x/no-unnecessary-key`**: Prevents `key` from being placed on non-top-level elements in a list rendering (credit to [@kachkaev](https://github.com/kachkaev) for the idea).
4646
- **`react-dom/no-string-style-prop`**: Disallows string values for the `style` prop, which is useful in non-TypeScript environments like MDX (proposed by [@karlhorky](https://github.com/karlhorky)).
4747
- **`react-dom/prefer-namespace-import`**: Enforces using a namespace import for `react-dom` (the React DOM equivalent of `react-x/prefer-namespace-import`).
4848

4949
## **Developer Experience (DX) Improvements**
5050

5151
We believe a great tool should not only find problems but also help you fix them.
5252

53-
- **Enhanced Codemods & Auto-Fixes**: More rules now include codemods and auto-fixing capabilities. For instance, `no-forward-ref` can automatically migrate legacy APIs to the new syntax available in React 19.
53+
- **Enhanced Codemods & Auto-Fixes**: More rules now include codemods and auto-fixing capabilities.
5454

5555
For example, migrating `forwardRef` to the new [`ref` as a prop](https://react.dev/blog/2024/12/05/react-19#ref-as-a-prop) pattern in React 19:
5656

apps/website/content/docs/rules/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ full: true
8080
| [`no-unstable-context-value`](./no-unstable-context-value) | 1️⃣ | | Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider` | |
8181
| [`no-unstable-default-props`](./no-unstable-default-props) | 1️⃣ | | Prevents using referential-type values as default props in object destructuring | |
8282
| [`no-unused-class-component-members`](./no-unused-class-component-members) | 1️⃣ | | Warns unused class component methods and properties | |
83-
| [`no-unused-props`](./no-unused-props) | 0️⃣ | `🧪` `💭` | Warns about unused component prop declarations | |
83+
| [`no-unused-props`](./no-unused-props) | 0️⃣ | `🧪` `💭` | Warns component props that are defined but never used | |
8484
| [`no-unused-state`](./no-unused-state) | 1️⃣ | | Warns unused class component state | |
8585
| [`no-use-context`](./no-use-context) | 1️⃣ | `🔄` | Replaces usages of `useContext` with `use` | >=19.0.0 |
8686
| [`no-useless-forward-ref`](./no-useless-forward-ref) | 1️⃣ | | Disallow useless `forwardRef` calls on components that don't use `ref`s | |

packages/plugins/eslint-plugin-react-x/src/rules/no-unused-props.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ react-x/no-unused-props
2424

2525
## Description
2626

27-
Warns about unused component prop declarations.
27+
Warns component props that are defined but never used.
2828

2929
Unused props increase maintenance overhead and may mislead consumers of the component into thinking the prop is required or meaningful, even when it has no effect.
3030

packages/plugins/eslint-plugin-react-x/src/rules/no-unused-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default createRule<[], MessageID>({
2020
meta: {
2121
type: "problem",
2222
docs: {
23-
description: "Warns about unused component prop declarations.",
23+
description: "Warns component props that are defined but never used.",
2424
[Symbol.for("rule_features")]: RULE_FEATURES,
2525
},
2626
messages: {

0 commit comments

Comments
 (0)