Skip to content

Commit 676369b

Browse files
committed
Update release notes for v2.0.0
The changes make the docs clearer and more accurate
1 parent f85a3c7 commit 676369b

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

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

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,84 +4,82 @@ description: "A major release embracing modern JavaScript standards with powerfu
44
---
55

66
<Callout type="info">
7-
Some of the new features in this release were already previewed in the `1.5.x` versions.
7+
Some features in this release were previously introduced in the `1.5.x` versions.
88
</Callout>
99

1010
## **Embracing Modern JavaScript Standards**
1111

1212
To align with the direction of the JavaScript ecosystem, v2.0.0 introduces the following significant changes:
1313

1414
1. **ESM-Only**: `eslint-react.xyz` is now distributed exclusively as ECMAScript Modules (ESM).
15-
2. **Flat Config Exclusive**: We have dropped support for the legacy `.eslintrc` format and now exclusively support ESLint's Flat Config for more powerful and flexible configurations.
15+
2. **Flat Config Exclusive**: We have dropped support for the legacy `.eslintrc` format and now exclusively support ESLint's Flat Config, enabling more powerful and flexible configurations.
1616
3. **Updated Environment Requirements**:
1717
- **Node.js**: `18.x``20.x`
1818
- **ESLint**: `8.x``9.x`
1919
- **TypeScript**: `4.x``5.x`
2020

2121
## **Rule Refactoring: More Consistent and Intuitive**
2222

23-
We have refactored our rules to make them easier to understand and use.
23+
We have refactored our rules to make them more consistent and intuitive.
2424

2525
- **Rule Renaming**: Some rules have been renamed. For example, `ensure-forward-ref-using-ref` is now the more concise `no-useless-forward-ref`.
2626

27-
- **Rule Consolidation**: Scenarios that previously required configuring opposing rules are now handled by a single rule, simplifying your setup.
27+
- **Rule Consolidation**: Scenarios that previously required multiple rules are now handled by a single, consolidated rule, simplifying your setup.
2828

2929
```javascript
30-
// Old way: Two opposing rules
30+
// Old way: Two separate rules
3131
// "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
3232
// "react-hooks-extra/no-direct-set-state-in-use-layout-effect": "warn",
3333

34-
// New way: Single consolidated rule handling all useEffect variants
34+
// New way: A single rule handling all useEffect variants
3535
"react-x/no-direct-set-state-in-use-effect": "warn",
3636
```
3737

38-
- **Rule Migration**: Several generic Hooks rules from the `react-hooks-extra` package have been moved to the core `react-x` plugin, such as `no-unnecessary-use-prefix`.
38+
- **Rule Migration**: Several generic Hooks rules from the `react-hooks-extra` package, such as `no-unnecessary-use-prefix`, have been moved to the core `react-x` plugin.
3939

4040
## **Introducing Powerful New Rules**
4141

4242
This release adds several new rules to help you write cleaner and more robust React code.
4343

44-
- **`react-x/no-unused-props`**: TSC-backed rule that flags component props that are defined but never used (credits to [@ulrichstark](https://github.com/ulrichstark) for the implementation).
45-
- **`react-x/no-unnecessary-key`**: Flags unnecessary `key` props on elements that are not an iterator when rendering lists (credits to [@kachkaev](https://github.com/kachkaev) for the idea).
46-
- **`react-dom/no-string-style-prop`**: Disallows using string values for the `style` prop, useful in non-TypeScript environments like MDX files (proposed by [@karlhorky](https://github.com/karlhorky)).
47-
- **`react-dom/prefer-namespace-import`**: Enforces using a namespace import for `react-dom` (The React DOM version of `react-x/prefer-namespace-import`).
44+
- **`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).
46+
- **`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)).
47+
- **`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, like `no-forward-ref`, now include codemods to automatically migrate legacy APIs to the new syntax in React 19 and support auto-fixing.
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.
5454

55-
For example, migrating `forwardRef`:
55+
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

5757
```tsx
58+
// Before
5859
const MotionButton = React.forwardRef<HTMLButtonElement, HTMLMotionProps<"button">>(({ children, ...rest }, ref) => {
5960
// ...
6061
});
61-
```
62-
63-
can be automatically transformed to:
6462

65-
```tsx
63+
// After
6664
const MotionButton = ({ ref, children, ...rest }: HTMLMotionProps<"button"> & { ref?: React.RefObject<HTMLButtonElement | null> }) => {
6765
// ...
6866
};
6967
```
7068

71-
Other rules with React 19 codemods include `no-context-provider` and `no-use-context`.
69+
Other rules with React 19 codemods include:
7270

73-
- `react-x/no-context-provider`: Replaces usages of `useContext(Context)` with `use(Context)`.
74-
- `react-x/no-use-context`: Replaces usages of `<Context.Provider>` with `<Context>`.
71+
- `react-x/no-use-context`: Replaces `useContext(Context)` with `use(Context)`.
72+
- `react-x/no-context-provider`: Replaces `<Context.Provider>` with `<Context>`.
7573

76-
- **New `disable-conflict-eslint-plugin-react` Preset**: If you also use `eslint-plugin-react`, this new preset automatically disables rules that overlap with our plugin, enabling seamless integration.
74+
- **New `disable-conflict-eslint-plugin-react` Preset**: If you also use `eslint-plugin-react`, this new preset automatically disables rules that conflict with our plugin, ensuring seamless integration.
7775

7876
## **Migration Guide**
7977

8078
To upgrade to v2.0.0, follow these steps:
8179

8280
1. **Update Node.js**: Ensure your environment is running Node.js 20.x or higher.
83-
2. **Update Dependencies**: Update your `eslint-react.xyz` and related dependencies to the required versions.
84-
3. **Review Rule Changes**: Check the [Changelog](/docs/changelog#v200-2025-09-26) for a complete list of rule changes and updates.
85-
4. **Adjust ESLint Configurations**: Update your ESLint configuration to accommodate renamed or consolidated rules (convert to Flat Config if you haven't already).
81+
2. **Update Dependencies**: Update ESLint plugins from `eslint-react.xyz` and its related dependencies to their required versions.
82+
3. **Review Rule Changes**: Check the [Changelog](/docs/changelog#v200-2025-09-26) for a complete list of rule changes.
83+
4. **Adjust ESLint Configuration**: Update your ESLint configuration to accommodate renamed or consolidated rules. If you haven't already, convert your configuration to Flat Config.
8684
5. **Update ESLint Directives**: Use the provided codemods to update any ESLint directives in your codebase.
87-
6. **Test Your Setup**: Run ESLint on your codebase to identify and fix any issues.
85+
6. **Test Your Setup**: Run ESLint on your project to identify and fix any remaining issues.

0 commit comments

Comments
 (0)