@samitouri / QOS-React / commits / d55cc79bcf

refactor(eslint-plugin-react-hooks): move rules to `rules` folder (#32411)

Since the compiler plugin is going to be merged into the hooks plugin, and ultimately decomposed into several more rules, it would be good to start creating a more traditional folder structure for the plugin. This change just moves the rules into a `rules` folder. Co-authored-by: lauren <poteto@users.noreply.github.com>

michael faith committed Feb 28, 2025 at 10:12 UTC d55cc79bcf5cd3bd4cb406381b067d72842f368e
4 files changed +4 -4
packages/eslint-plugin-react-hooks/README.md
+2 -2
@@ -36,7 +36,7 @@ If you are still using ESLint below 9.0.0, please continue to use `recommended-l
36 For [ESLint 9.0.0 and above](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/) users, add the `recommended-latest` config.
37
38 ```js
39 -import reactHooks from 'eslint-plugin-react-hooks';
39 +import * as reactHooks from 'eslint-plugin-react-hooks';
40
41 export default [
42 // ...
@@ -67,7 +67,7 @@ If you want more fine-grained configuration, you can instead add a snippet like
67 #### Flat Config (eslint.config.js)
68
69 ```js
70 -import reactHooks from 'eslint-plugin-react-hooks';
70 +import * as reactHooks from 'eslint-plugin-react-hooks';
71
72 export default [
73 {
packages/eslint-plugin-react-hooks/src/index.ts
+2 -2
@@ -4,8 +4,8 @@
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7 -import RulesOfHooks from './RulesOfHooks';
8 -import ExhaustiveDeps from './ExhaustiveDeps';
7 +import RulesOfHooks from './rules/RulesOfHooks';
8 +import ExhaustiveDeps from './rules/ExhaustiveDeps';
9 import type {ESLint, Linter, Rule} from 'eslint';
10
11 // All rules
packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts renamed
packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts renamed