-
Notifications
You must be signed in to change notification settings - Fork 48.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(eslint-plugin-react-hooks): move rules to rules
folder
#32411
refactor(eslint-plugin-react-hooks): move rules to rules
folder
#32411
Conversation
857b0e8
to
0ac91db
Compare
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.
0ac91db
to
fae7a49
Compare
Comparing: 56c7d10...9dec11d Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
@@ -67,7 +67,7 @@ If you want more fine-grained configuration, you can instead add a snippet like | |||
#### Flat Config (eslint.config.js) | |||
|
|||
```js | |||
import reactHooks from 'eslint-plugin-react-hooks'; | |||
import * as reactHooks from 'eslint-plugin-react-hooks'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are functionally equal as far as I'm aware. Why change to the (imho) uglier * as
form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For use in TypeScript, since the plugin doesn't have a default export
(for backwards compatibility), if a user doesn't have allowSyntheticDefaultImports
turned on in their tsconfig
, they'll get a type error with the previous form. Figured it would be easier to provide the form that work for both js and ts, rather than have a specific example just for TS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I guess any sane user runs Typescript with allowSyntheticDefaultImports
these days, likely coming from moduleResultion: "bundler"
. But I won't further push regarding this :)
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.