|
2 | 2 |
|
3 | 3 | ## What is the purpose of `eslint-react`?
|
4 | 4 |
|
5 |
| -The purpose of `eslint-react` is to provide a platform for creating ESLint rules for not just for React DOM but also other libraries and frameworks that use React as a runtime. |
| 5 | +The purpose of `eslint-react` is to provide ESLint rules for not just for React DOM but also other libraries and frameworks that use React as a runtime. |
6 | 6 |
|
7 |
| -## What is the purpose of `@eslint-react/eslint-plugin`? |
| 7 | +## What are the differences between `@eslint-react/eslint-plugin` and `eslint-plugin-react`? |
8 | 8 |
|
9 |
| -The purpose of `@eslint-react/eslint-plugin` is to have a single package to put all the rules provided by `eslint-react`. |
| 9 | +The main difference is when using `@eslint-react/eslint-plugin` you can customize the behavior of the rules depending on the what render target you are using. While `eslint-plugin-react` will always assume you are using React DOM even if you are working with a project that only uses React Three Fiber (You can learn more through encounters like [1] in [2]). |
10 | 10 |
|
11 |
| -## Is this a replacement for `eslint-plugin-react`? |
| 11 | +## Is `@eslint-react/eslint-plugin` a replacement for `eslint-plugin-react`? |
12 | 12 |
|
13 |
| -No, `eslint-react` or `@eslint-react/eslint-plugin` is not meant to be a drop-in replacement for `eslint-plugin-react`. But you can still using it as a replacement if you want to. |
| 13 | +No, `@eslint-react/eslint-plugin` is not meant to be a drop-in replacement for `eslint-plugin-react`. But you can still using it as a replacement if you want to. Keep in mind that certain rules may behave differently, and the rules provided by `eslint-react` are more adhere to [react.dev](https://react.dev/). |
14 | 14 |
|
15 |
| -## What are the differences between `@eslint-react/eslint-plugin` and `eslint-plugin-react` offering for the same rule |
16 |
| - |
17 |
| -1. Rules from `@eslint-react/eslint-plugin` not bind to any specific render target (e.g. React DOM, React Three Fiber, React Native, etc.)\ |
18 |
| - While rules from `@eslint-react/eslint-plugin` will always assume you are using React DOM, even if you are working with a project that only uses React Three Fiber. |
19 |
| -2. Rules provided by `@eslint-react/eslint-plugin` are more adhere to [react.dev](https://react.dev). |
20 |
| -3. Rules provided by `eslint-react` are more sensible, predictable and accurate than the rules provided by `eslint-plugin-react`. |
| 15 | +[1]: https://github.com/pmndrs/react-three-fiber/discussions/2487 |
| 16 | +[2]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3423#issuecomment-1930936266 |
0 commit comments