Skip to content

Commit 20eb74a

Browse files
committed
docs: improve rules descriptions
1 parent 939b01c commit 20eb74a

15 files changed

+23
-23
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ full: true
3333
| [`no-clone-element`](./no-clone-element) | 1️⃣ | `🔍` | Prevents using `cloneElement`. | |
3434
| [`no-comment-textnodes`](./no-comment-textnodes) | 1️⃣ | `🔍` | Prevents comments from being inserted as text nodes. | |
3535
| [`no-complex-conditional-rendering`](./no-complex-conditional-rendering) | 0️⃣ | `🔍` | Prevents complex conditional rendering in JSX. | |
36-
| [`no-component-will-mount`](./no-component-will-mount) | 2️⃣ | `🔍` `🔄` | Prevents using `componentWillMount`. | >=16.3.0 |
37-
| [`no-component-will-receive-props`](./no-component-will-receive-props) | 2️⃣ | `🔍` `🔄` | Prevents using `componentWillReceiveProps`. | >=16.3.0 |
38-
| [`no-component-will-update`](./no-component-will-update) | 2️⃣ | `🔍` `🔄` | Prevents using `componentWillUpdate`. | >=16.3.0 |
39-
| [`no-context-provider`](./no-context-provider) | 1️⃣ | `🔍` `🔄` | Prevents using `<Context.Provider>`. | >=19.0.0 |
36+
| [`no-component-will-mount`](./no-component-will-mount) | 2️⃣ | `🔍` `🔄` | Replaces `componentWillMount` with `UNSAFE_componentWillMount`. | >=16.3.0 |
37+
| [`no-component-will-receive-props`](./no-component-will-receive-props) | 2️⃣ | `🔍` `🔄` | Replaces `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`. | >=16.3.0 |
38+
| [`no-component-will-update`](./no-component-will-update) | 2️⃣ | `🔍` `🔄` | Replaces `componentWillUpdate` with `UNSAFE_componentWillUpdate`. | >=16.3.0 |
39+
| [`no-context-provider`](./no-context-provider) | 1️⃣ | `🔍` `🔄` | Replaces `<Context.Provider>` with `<Context>`. | >=19.0.0 |
4040
| [`no-create-ref`](./no-create-ref) | 2️⃣ | `🔍` | Prevents using `createRef`. | |
4141
| [`no-default-props`](./no-default-props) | 2️⃣ | `🔍` | Prevents using `defaultProps` property in favor of ES6 default parameters. | |
4242
| [`no-direct-mutation-state`](./no-direct-mutation-state) | 2️⃣ | `🔍` | Prevents direct mutation of `this.state`. | |
4343
| [`no-duplicate-jsx-props`](./no-duplicate-jsx-props) | 1️⃣ | `🔍` | Prevents duplicate props in JSX. | |
4444
| [`no-duplicate-key`](./no-duplicate-key) | 2️⃣ | `🔍` | Prevents duplicate `key` on elements in the same array or a list of `children`. | |
45-
| [`no-forward-ref`](./no-forward-ref) | 1️⃣ | `🔍` `🔄` | Prevents using `React.forwardRef`. | >=19.0.0 |
45+
| [`no-forward-ref`](./no-forward-ref) | 1️⃣ | `🔍` `🔄` | Replaces `forwardRef` with passing `ref` as a prop. | >=19.0.0 |
4646
| [`no-implicit-key`](./no-implicit-key) | 1️⃣ | `🔍` | Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects). | |
4747
| [`no-leaked-conditional-rendering`](./no-leaked-conditional-rendering) | 1️⃣ | `🔍` `💭` | Prevents problematic leaked values from being rendered. | |
4848
| [`no-missing-component-display-name`](./no-missing-component-display-name) | 0️⃣ | `🔍` | Enforces that all components have a `displayName` which can be used in devtools. | |
@@ -62,13 +62,13 @@ full: true
6262
| [`no-unstable-default-props`](./no-unstable-default-props) | 1️⃣ | `🔍` | Prevents using referential-type values as default props in object destructuring. | |
6363
| [`no-unused-class-component-members`](./no-unused-class-component-members) | 0️⃣ | `🔍` | Warns unused class component methods and properties. | |
6464
| [`no-unused-state`](./no-unused-state) | 1️⃣ | `🔍` | Warns unused class component state. | |
65-
| [`no-use-context`](./no-use-context) | 1️⃣ | `🔍` `🔄` | Prevents using `useContext` in favor of `use`. | >=19.0.0 |
65+
| [`no-use-context`](./no-use-context) | 1️⃣ | `🔍` `🔄` | Replaces `useContext` with `use`. | >=19.0.0 |
6666
| [`no-useless-fragment`](./no-useless-fragment) | 1️⃣ | `🔍` `🔧` `⚙️` | Prevents using useless `fragment` components or `<>` syntax. | |
6767
| [`prefer-destructuring-assignment`](./prefer-destructuring-assignment) | 0️⃣ | `🔍` | Enforces using destructuring assignment over property assignment. | |
6868
| [`prefer-react-namespace-import`](./prefer-react-namespace-import) | 0️⃣ | `🔍` `🔧` | Enforces React is imported via a namespace import | |
6969
| [`prefer-read-only-props`](./prefer-read-only-props) | 0️⃣ | `🔍` `💭` | Enforces read-only props in components. | |
70-
| [`prefer-shorthand-boolean`](./prefer-shorthand-boolean) | 0️⃣ | `🔍` `🔧` | Enforces using shorthand syntax for boolean attributes. | |
71-
| [`prefer-shorthand-fragment`](./prefer-shorthand-fragment) | 0️⃣ | `🔍` `🔧` | Enforces using shorthand syntax for fragments. | |
70+
| [`prefer-shorthand-boolean`](./prefer-shorthand-boolean) | 0️⃣ | `🔍` `🔧` | Enforces the use of shorthand syntax for boolean attributes. | |
71+
| [`prefer-shorthand-fragment`](./prefer-shorthand-fragment) | 0️⃣ | `🔍` `🔧` | Enforces the use of shorthand syntax for fragments. | |
7272
| [`use-jsx-vars`](./use-jsx-vars) | 1️⃣ | | Marks variables used in JSX as used. | |
7373

7474
## DOM Rules
@@ -114,7 +114,7 @@ full: true
114114
| Rule || Features | Description |
115115
| :------------------------------------------------------------- | :- | :------- | :------------------------------------------------------------------------------- |
116116
| [`component-name`](./naming-convention-component-name) | 0️⃣ | `🔍` `⚙️` | Enforces naming conventions for components. |
117-
| [`context-name`](./naming-convention-context-name) | 1️⃣ | `🔍` | Enforces context name to be a valid component name with the suffix `Context`. |
117+
| [`context-name`](./naming-convention-context-name) | 1️⃣ | `🔍` | Enforces context name to be a valid component name with the suffix 'Context'. |
118118
| [`filename`](./naming-convention-filename) | 0️⃣ | `🔍` `⚙️` | Enforces consistent file naming conventions. |
119119
| [`filename-extension`](./naming-convention-filename-extension) | 0️⃣ | `🔍` `⚙️` | Enforces consistent use of the JSX file extension. |
120120
| [`use-state`](./naming-convention-use-state) | 1️⃣ | `🔍` | Enforces destructuring and symmetric naming of `useState` hook value and setter. |

packages/plugins/eslint-plugin-react-x/src/rules/no-component-will-mount.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ react-x/no-component-will-mount
2727

2828
## What it does
2929

30-
Prevents usage of `componentWillMount` in class components.
30+
Replaces `componentWillMount` with `UNSAFE_componentWillMount`.
3131

3232
This API has been renamed from `componentWillMount` to `UNSAFE_componentWillMount`. The old name has been deprecated. In a future major version of React, only the new name will work.
3333

packages/plugins/eslint-plugin-react-x/src/rules/no-component-will-mount.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default createRule<[], MessageID>({
2626
meta: {
2727
type: "problem",
2828
docs: {
29-
description: "disallow using 'componentWillMount'",
29+
description: "replace 'componentWillMount' with 'UNSAFE_componentWillMount'",
3030
[Symbol.for("rule_features")]: RULE_FEATURES,
3131
},
3232
fixable: "code",

packages/plugins/eslint-plugin-react-x/src/rules/no-component-will-receive-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ react-x/no-component-will-receive-props
2727

2828
## What it does
2929

30-
Prevents usage of `componentWillReceiveProps` in class components.
30+
Replaces `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`.
3131

3232
This API has been renamed from `componentWillReceiveProps` to `UNSAFE_componentWillReceiveProps`. The old name has been deprecated. In a future major version of React, only the new name will work.
3333

packages/plugins/eslint-plugin-react-x/src/rules/no-component-will-receive-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default createRule<[], MessageID>({
2626
meta: {
2727
type: "problem",
2828
docs: {
29-
description: "disallow using 'componentWillReceiveProps'",
29+
description: "replace 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'",
3030
[Symbol.for("rule_features")]: RULE_FEATURES,
3131
},
3232
fixable: "code",

packages/plugins/eslint-plugin-react-x/src/rules/no-component-will-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ react-x/no-component-will-update
2727

2828
## What it does
2929

30-
Prevents usage of `componentWillUpdate` in class components.
30+
Replaces `componentWillUpdate` with `UNSAFE_componentWillUpdate`.
3131

3232
This API has been renamed from `componentWillUpdate` to `UNSAFE_componentWillUpdate`. The old name has been deprecated. In a future major version of React, only the new name will work.
3333

packages/plugins/eslint-plugin-react-x/src/rules/no-component-will-update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default createRule<[], MessageID>({
2626
meta: {
2727
type: "problem",
2828
docs: {
29-
description: "disallow using 'componentWillReceiveProps'",
29+
description: "replace 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'",
3030
[Symbol.for("rule_features")]: RULE_FEATURES,
3131
},
3232
fixable: "code",

packages/plugins/eslint-plugin-react-x/src/rules/no-context-provider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ react-x/no-context-provider
2727

2828
## What it does
2929

30-
Disallows using `<Context.Provider>`.
30+
Replaces `<Context.Provider>` with `<Context>`.
3131

3232
In React 19, you can render `<Context>` as a provider instead of `<Context.Provider>`.
3333

packages/plugins/eslint-plugin-react-x/src/rules/no-context-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default createRule<[], MessageID>({
1919
meta: {
2020
type: "problem",
2121
docs: {
22-
description: "disallow the use of '<Context.Provider>'",
22+
description: "replace '<Context.Provider>' with '<Context>'",
2323
[Symbol.for("rule_features")]: RULE_FEATURES,
2424
},
2525
fixable: "code",

packages/plugins/eslint-plugin-react-x/src/rules/no-forward-ref.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ react-x/no-forward-ref
2727

2828
## What it does
2929

30-
Disallows using `React.forwardRef`.
30+
Replaces `forwardRef` with passing `ref` as a prop.
3131

3232
In React 19, `forwardRef` is no longer necessary. Pass `ref` as a prop instead.
3333

0 commit comments

Comments
 (0)