Skip to content

Commit c836066

Browse files
committed
docs: update changelog and add removed rules documentation
1 parent 9e6d1f6 commit c836066

File tree

7 files changed

+183
-112
lines changed

7 files changed

+183
-112
lines changed

CHANGELOG.md

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,56 @@
1010
- Drop support for ESLint 8, minimum required version is now ESLint 9.3.6
1111
- Drop support for TypeScript 4, minimum required version is now TypeScript 5.9.2
1212

13-
**The following rules have been renamed:**
14-
15-
- `react-x/no-comment-textnodes` -> `react-x/jsx-no-comment-textnodes`
16-
- `react-x/no-nested-components` -> `react-x/no-nested-component-definitions`
17-
- `react-x/prefer-react-namespace-import` -> `react-x/prefer-namespace-import`
18-
19-
**The following rules have been consolidated into new rules:**
20-
21-
- `react-x/jsx-shorthand-boolean` replaces `avoid-shorthand-boolean` and `prefer-shorthand-boolean`
22-
- `react-x/jsx-shorthand-fragment` replaces `avoid-shorthand-fragment` and `prefer-shorthand-fragment`
23-
- `react-hooks-extra/no-direct-set-state-in-use-effect` replaces `no-direct-set-state-in-use-layout-effect`
24-
25-
**The following rules have been moved to new plugins:**
26-
27-
- `react-hooks-extra/no-unnecessary-use-callback` -> `react-x/no-unnecessary-use-callback`
28-
- `react-hooks-extra/no-unnecessary-use-memo` -> `react-x/no-unnecessary-use-memo`
29-
- `react-hooks-extra/no-unnecessary-use-prefix` -> `react-x/no-unnecessary-use-prefix`
30-
- `react-hooks-extra/prefer-use-state-lazy-initialization` -> `react-x/prefer-use-state-lazy-initialization`
31-
32-
**The following settings have been removed from `settings["react-x"]`:**
33-
34-
- `additionalComponents`
35-
- `additionalHooks`
36-
- `skipImportCheck`
37-
38-
### ✨ New
39-
40-
Added the following new rules:
13+
**Removed Rules**
14+
15+
| Rule | Replaced by | Reason |
16+
| :------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- | :----------- |
17+
| [`react-x/avoid-shorthand-boolean`](/docs/rules/avoid-shorthand-boolean) | [`react-x/jsx-shorthand-boolean`](/docs/rules/jsx-shorthand-boolean) | consolidated |
18+
| [`react-x/avoid-shorthand-fragment`](/docs/rules/avoid-shorthand-fragment) | [`react-x/jsx-shorthand-fragment`](/docs/rules/jsx-shorthand-fragment) | consolidated |
19+
| [`react-x/ensure-forward-ref-using-ref`](/docs/rules/ensure-forward-ref-using-ref) | [`react-x/no-useless-forward-ref`](/docs/rules/no-useless-forward-ref) | renamed |
20+
| [`react-x/jsx-no-duplicate-props`](/docs/rules/jsx-no-duplicate-props) | [`react-x/jsx-no-duplicate-props`](/docs/rules/jsx-no-duplicate-props) | renamed |
21+
| [`react-x/no-comment-textnodes`](/docs/rules/no-comment-textnodes) | [`react-x/jsx-no-comment-textnodes`](/docs/rules/jsx-no-comment-textnodes) | renamed |
22+
| [`react-x/no-complicated-conditional-rendering`](/docs/rules/no-complicated-conditional-rendering) | | discontinued |
23+
| [`react-x/no-nested-components`](/docs/rules/no-nested-components) | [`react-x/no-nested-component-definitions`](/docs/rules/no-nested-component-definitions) | renamed |
24+
| [`react-x/prefer-react-namespace-import`](/docs/rules/prefer-react-namespace-import) | [`react-x/prefer-namespace-import`](/docs/rules/prefer-namespace-import) | renamed |
25+
| [`react-x/prefer-shorthand-boolean`](/docs/rules/prefer-shorthand-boolean) | [`react-x/jsx-shorthand-boolean`](/docs/rules/jsx-shorthand-boolean) | consolidated |
26+
| [`react-x/prefer-shorthand-fragment`](/docs/rules/prefer-shorthand-fragment) | [`react-x/jsx-shorthand-fragment`](/docs/rules/jsx-shorthand-fragment) | consolidated |
27+
| [`react-x/use-jsx-vars`](/docs/rules/use-jsx-vars) | [`react-x/jsx-uses-vars`](/docs/rules/jsx-uses-vars) | renamed |
28+
| [`react-dom/no-children-in-void-dom-elements`](/docs/rules/dom-no-children-in-void-dom-elements) | [`react-dom/no-void-elements-with-children`](/docs/rules/dom-no-void-elements-with-children) | renamed |
29+
| [`react-hooks-extra/no-direct-set-state-in-use-layout-effect`](/docs/rules/hooks-extra-no-direct-set-state-in-use-layout-effect) | [`react-hooks-extra/no-direct-set-state-in-use-effect`](/docs/rules/hooks-extra-no-direct-set-state-in-use-effect) | consolidated |
30+
| [`react-hooks-extra/no-unnecessary-use-callback`](/docs/rules/hooks-extra-no-unnecessary-use-callback) | [`react-x/no-unnecessary-use-callback`](/docs/rules/no-unnecessary-use-callback) | relocated |
31+
| [`react-hooks-extra/no-unnecessary-use-memo`](/docs/rules/hooks-extra-no-unnecessary-use-memo) | [`react-x/no-unnecessary-use-memo`](/docs/rules/no-unnecessary-use-memo) | relocated |
32+
| [`react-hooks-extra/no-unnecessary-use-prefix`](/docs/rules/hooks-extra-no-unnecessary-use-prefix) | [`react-x/no-unnecessary-use-prefix`](/docs/rules/no-unnecessary-use-prefix) | relocated |
33+
| [`react-hooks-extra/prefer-use-state-lazy-initialization`](/docs/rules/hooks-extra-prefer-use-state-lazy-initialization) | [`react-x/prefer-use-state-lazy-initialization`](/docs/rules/prefer-use-state-lazy-initialization) | relocated |
34+
35+
**Removed Presets**
36+
37+
| Preset | Replaced by | Reason |
38+
| :-------------------------------- | :------------ | :----------- |
39+
| `core` | `x` | renamed |
40+
| `core-legacy` | | discontinued |
41+
| `off-dom` | `disable-dom` | renamed |
42+
| `off-dom-legacy` | | discontinued |
43+
| `x-legacy` | | discontinued |
44+
| `dom-legacy` | | discontinued |
45+
| `web-api-legacy` | | discontinued |
46+
| `recommended-legacy` | | discontinued |
47+
| `recommended-typescript-legacy` | | discontinued |
48+
| `recommended-type-checked-legacy` | | discontinued |
49+
50+
**Removed Settings**
51+
52+
| Setting | Replaced by | Reason |
53+
| :--------------------- | :---------- | :----------- |
54+
| `additionalComponents` | | discontinued |
55+
| `additionalHooks` | | discontinued |
56+
| `skipImportCheck` | | discontinued |
57+
58+
The rule implementations have been refactored to improve performance and maintainability.
59+
60+
### ✨ New
61+
62+
**Added the following new rules:**
4163

4264
- `react-x/jsx-shorthand-boolean`: Enforces a consistent style for boolean attributes
4365
- `react-x/jsx-shorthand-fragment`: Enforces a consistent style for React Fragments
@@ -47,11 +69,11 @@ Added the following new rules:
4769
- `react-dom/no-string-style-prop`: Disallows string values for the `style` prop
4870
- `react-dom/prefer-namespace-import`: Enforces using a namespace import for `react-dom`
4971

50-
Added the following new rule to the `recommended-type-checked` preset:
72+
**Added the following new rule to the `recommended-type-checked` preset:**
5173

5274
- `react-x/no-unused-props`: Reports unused props in components
5375

54-
The following rules now support Codemod features:
76+
**The following rules now support Codemod features:**
5577

5678
- `react-x/no-component-did-update`
5779
- `react-x/no-component-will-receive-props`
@@ -60,18 +82,18 @@ The following rules now support Codemod features:
6082
- `react-x/no-forward-ref`
6183
- `react-x/no-string-refs`
6284

63-
The following rules now support auto-fix:
85+
**The following rules now support auto-fix:**
6486

6587
- `react-x/prefer-namespace-import`
6688
- `react-dom/prefer-namespace-import`
6789

68-
The following rules now support suggestion fixes:
90+
**The following rules now support suggestion fixes:**
6991

7092
- `react-dom/no-missing-button-type`
7193
- `react-dom/no-missing-iframe-sandbox`
7294
- `react-dom/no-unsafe-target-blank`
7395

74-
New configuration preset added:
96+
**New configuration preset added:**
7597

7698
- `disable-conflict-eslint-plugin-react`: Disable rules in `eslint-plugin-react` that conflict with rules in our plugins
7799

@@ -83,8 +105,8 @@ New configuration preset added:
83105

84106
### 🪄 Improvements
85107

108+
- refactor: simplify React APIs detection logic
86109
- refactor: cleanup utilities and simplify rule implementations
87-
- refactor: rework React API detection logic to better align with `eslint-plugin-react-hooks`
88110
- docs: add comparison table between `eslint-plugin-react` and `eslint-react` rules
89111
- docs: replace `tseslint.config` with `defineConfig` in all examples
90112
- build: migrate build system from `tsup` to `tsdown` for better performance

apps/website/content/docs/changelog.md

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,56 @@ title: Changelog
1414
- Drop support for ESLint 8, minimum required version is now ESLint 9.3.6
1515
- Drop support for TypeScript 4, minimum required version is now TypeScript 5.9.2
1616

17-
**The following rules have been renamed:**
18-
19-
- `react-x/no-comment-textnodes` -> `react-x/jsx-no-comment-textnodes`
20-
- `react-x/no-nested-components` -> `react-x/no-nested-component-definitions`
21-
- `react-x/prefer-react-namespace-import` -> `react-x/prefer-namespace-import`
22-
23-
**The following rules have been consolidated into new rules:**
24-
25-
- `react-x/jsx-shorthand-boolean` replaces `avoid-shorthand-boolean` and `prefer-shorthand-boolean`
26-
- `react-x/jsx-shorthand-fragment` replaces `avoid-shorthand-fragment` and `prefer-shorthand-fragment`
27-
- `react-hooks-extra/no-direct-set-state-in-use-effect` replaces `no-direct-set-state-in-use-layout-effect`
28-
29-
**The following rules have been moved to new plugins:**
30-
31-
- `react-hooks-extra/no-unnecessary-use-callback` -> `react-x/no-unnecessary-use-callback`
32-
- `react-hooks-extra/no-unnecessary-use-memo` -> `react-x/no-unnecessary-use-memo`
33-
- `react-hooks-extra/no-unnecessary-use-prefix` -> `react-x/no-unnecessary-use-prefix`
34-
- `react-hooks-extra/prefer-use-state-lazy-initialization` -> `react-x/prefer-use-state-lazy-initialization`
35-
36-
**The following settings have been removed from `settings["react-x"]`:**
37-
38-
- `additionalComponents`
39-
- `additionalHooks`
40-
- `skipImportCheck`
41-
42-
### ✨ New
43-
44-
Added the following new rules:
17+
**Removed Rules**
18+
19+
| Rule | Replaced by | Reason |
20+
| :------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- | :----------- |
21+
| [`react-x/avoid-shorthand-boolean`](/docs/rules/avoid-shorthand-boolean) | [`react-x/jsx-shorthand-boolean`](/docs/rules/jsx-shorthand-boolean) | consolidated |
22+
| [`react-x/avoid-shorthand-fragment`](/docs/rules/avoid-shorthand-fragment) | [`react-x/jsx-shorthand-fragment`](/docs/rules/jsx-shorthand-fragment) | consolidated |
23+
| [`react-x/ensure-forward-ref-using-ref`](/docs/rules/ensure-forward-ref-using-ref) | [`react-x/no-useless-forward-ref`](/docs/rules/no-useless-forward-ref) | renamed |
24+
| [`react-x/jsx-no-duplicate-props`](/docs/rules/jsx-no-duplicate-props) | [`react-x/jsx-no-duplicate-props`](/docs/rules/jsx-no-duplicate-props) | renamed |
25+
| [`react-x/no-comment-textnodes`](/docs/rules/no-comment-textnodes) | [`react-x/jsx-no-comment-textnodes`](/docs/rules/jsx-no-comment-textnodes) | renamed |
26+
| [`react-x/no-complicated-conditional-rendering`](/docs/rules/no-complicated-conditional-rendering) | | discontinued |
27+
| [`react-x/no-nested-components`](/docs/rules/no-nested-components) | [`react-x/no-nested-component-definitions`](/docs/rules/no-nested-component-definitions) | renamed |
28+
| [`react-x/prefer-react-namespace-import`](/docs/rules/prefer-react-namespace-import) | [`react-x/prefer-namespace-import`](/docs/rules/prefer-namespace-import) | renamed |
29+
| [`react-x/prefer-shorthand-boolean`](/docs/rules/prefer-shorthand-boolean) | [`react-x/jsx-shorthand-boolean`](/docs/rules/jsx-shorthand-boolean) | consolidated |
30+
| [`react-x/prefer-shorthand-fragment`](/docs/rules/prefer-shorthand-fragment) | [`react-x/jsx-shorthand-fragment`](/docs/rules/jsx-shorthand-fragment) | consolidated |
31+
| [`react-x/use-jsx-vars`](/docs/rules/use-jsx-vars) | [`react-x/jsx-uses-vars`](/docs/rules/jsx-uses-vars) | renamed |
32+
| [`react-dom/no-children-in-void-dom-elements`](/docs/rules/dom-no-children-in-void-dom-elements) | [`react-dom/no-void-elements-with-children`](/docs/rules/dom-no-void-elements-with-children) | renamed |
33+
| [`react-hooks-extra/no-direct-set-state-in-use-layout-effect`](/docs/rules/hooks-extra-no-direct-set-state-in-use-layout-effect) | [`react-hooks-extra/no-direct-set-state-in-use-effect`](/docs/rules/hooks-extra-no-direct-set-state-in-use-effect) | consolidated |
34+
| [`react-hooks-extra/no-unnecessary-use-callback`](/docs/rules/hooks-extra-no-unnecessary-use-callback) | [`react-x/no-unnecessary-use-callback`](/docs/rules/no-unnecessary-use-callback) | relocated |
35+
| [`react-hooks-extra/no-unnecessary-use-memo`](/docs/rules/hooks-extra-no-unnecessary-use-memo) | [`react-x/no-unnecessary-use-memo`](/docs/rules/no-unnecessary-use-memo) | relocated |
36+
| [`react-hooks-extra/no-unnecessary-use-prefix`](/docs/rules/hooks-extra-no-unnecessary-use-prefix) | [`react-x/no-unnecessary-use-prefix`](/docs/rules/no-unnecessary-use-prefix) | relocated |
37+
| [`react-hooks-extra/prefer-use-state-lazy-initialization`](/docs/rules/hooks-extra-prefer-use-state-lazy-initialization) | [`react-x/prefer-use-state-lazy-initialization`](/docs/rules/prefer-use-state-lazy-initialization) | relocated |
38+
39+
**Removed Presets**
40+
41+
| Preset | Replaced by | Reason |
42+
| :-------------------------------- | :------------ | :----------- |
43+
| `core` | `x` | renamed |
44+
| `core-legacy` | | discontinued |
45+
| `off-dom` | `disable-dom` | renamed |
46+
| `off-dom-legacy` | | discontinued |
47+
| `x-legacy` | | discontinued |
48+
| `dom-legacy` | | discontinued |
49+
| `web-api-legacy` | | discontinued |
50+
| `recommended-legacy` | | discontinued |
51+
| `recommended-typescript-legacy` | | discontinued |
52+
| `recommended-type-checked-legacy` | | discontinued |
53+
54+
**Removed Settings**
55+
56+
| Setting | Replaced by | Reason |
57+
| :--------------------- | :---------- | :----------- |
58+
| `additionalComponents` | | discontinued |
59+
| `additionalHooks` | | discontinued |
60+
| `skipImportCheck` | | discontinued |
61+
62+
The rule implementations have been refactored to improve performance and maintainability.
63+
64+
### ✨ New
65+
66+
**Added the following new rules:**
4567

4668
- `react-x/jsx-shorthand-boolean`: Enforces a consistent style for boolean attributes
4769
- `react-x/jsx-shorthand-fragment`: Enforces a consistent style for React Fragments
@@ -51,11 +73,11 @@ Added the following new rules:
5173
- `react-dom/no-string-style-prop`: Disallows string values for the `style` prop
5274
- `react-dom/prefer-namespace-import`: Enforces using a namespace import for `react-dom`
5375

54-
Added the following new rule to the `recommended-type-checked` preset:
76+
**Added the following new rule to the `recommended-type-checked` preset:**
5577

5678
- `react-x/no-unused-props`: Reports unused props in components
5779

58-
The following rules now support Codemod features:
80+
**The following rules now support Codemod features:**
5981

6082
- `react-x/no-component-did-update`
6183
- `react-x/no-component-will-receive-props`
@@ -64,18 +86,18 @@ The following rules now support Codemod features:
6486
- `react-x/no-forward-ref`
6587
- `react-x/no-string-refs`
6688

67-
The following rules now support auto-fix:
89+
**The following rules now support auto-fix:**
6890

6991
- `react-x/prefer-namespace-import`
7092
- `react-dom/prefer-namespace-import`
7193

72-
The following rules now support suggestion fixes:
94+
**The following rules now support suggestion fixes:**
7395

7496
- `react-dom/no-missing-button-type`
7597
- `react-dom/no-missing-iframe-sandbox`
7698
- `react-dom/no-unsafe-target-blank`
7799

78-
New configuration preset added:
100+
**New configuration preset added:**
79101

80102
- `disable-conflict-eslint-plugin-react`: Disable rules in `eslint-plugin-react` that conflict with rules in our plugins
81103

@@ -87,8 +109,8 @@ New configuration preset added:
87109

88110
### 🪄 Improvements
89111

112+
- refactor: simplify React APIs detection logic
90113
- refactor: cleanup utilities and simplify rule implementations
91-
- refactor: rework React API detection logic to better align with `eslint-plugin-react-hooks`
92114
- docs: add comparison table between `eslint-plugin-react` and `eslint-react` rules
93115
- docs: replace `tseslint.config` with `defineConfig` in all examples
94116
- build: migrate build system from `tsup` to `tsdown` for better performance

0 commit comments

Comments
 (0)