Skip to content
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

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

michaelfaith
Copy link
Contributor

@michaelfaith michaelfaith commented Feb 17, 2025

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.

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.
@react-sizebot
Copy link

react-sizebot commented Feb 17, 2025

Comparing: 56c7d10...9dec11d

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 518.24 kB 518.24 kB = 92.43 kB 92.43 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 570.57 kB 570.57 kB = 101.56 kB 101.56 kB
facebook-www/ReactDOM-prod.classic.js = 638.06 kB 638.06 kB = 112.28 kB 112.28 kB
facebook-www/ReactDOM-prod.modern.js = 628.38 kB 628.38 kB = 110.70 kB 110.70 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 038a5fe

@michaelfaith michaelfaith marked this pull request as ready for review February 17, 2025 15:31
@@ -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';
Copy link

@silverwind silverwind Feb 18, 2025

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?

Copy link
Contributor Author

@michaelfaith michaelfaith Feb 22, 2025

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.

Copy link

@silverwind silverwind Feb 24, 2025

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 :)

@poteto poteto merged commit d55cc79 into facebook:main Feb 28, 2025
193 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants