KEMBAR78
feat(eslint-plugin-react-hooks): make flat config the `recommended` config by michaelfaith · Pull Request #32457 · facebook/react · GitHub
Skip to content

Conversation

@michaelfaith
Copy link
Contributor

This change swaps which config recommended is aliasing. In 5.2.0, the new flat config was introduced as recommended-latest, while recommended still pointed at the legacy rc-based config, with a note that in the next major version recommended would be updated to point at recommend-latest. This change makes that swap, and make the default recommended experience the flat config. To continue using the legacy rc recommended config, please make the following change in your config

- extends: ['plugin:react-hooks/recommended']
+ extends: ['plugin:react-hooks/recommended-legacy']

This change also deprecates recommended-latest in favor of recommended. recommended-latest will be removed in a future major version.

The README has been updated to reflect the new usage, and to put the flat config sections before the legacy config sections.

I also took the opportunity to change the v9 fixture to use a typescript config, serving as a demonstration for usage as well as a way to validate the types are correct.

BREAKING CHANGE

…onfig

This change swaps which config `recommended` is aliasing.  In 5.2.0, the new flat config was introduced as `recommended-latest`, while `recommended` still pointed at the legacy rc-based config, with a note that in the next major version `recommended` would be updated to point at `recommend-latest`.  This change makes that swap, and make the default `recommended` experience the flat config.  To continue using the legacy rc recommended config, please make the following change in your config

```diff
- extends: ['plugin:react-hooks/recommended']
+ extends: ['plugin:react-hooks/recommended-legacy']
```

This change also deprecates `recommended-latest` in favor of `recommended.  `recommended-latest` will be removed in a future major version.

BREAKING CHANGE
This change updates the README to prioritize flat config and
updates the usage examples to reflect the change in recommended configs.
This change  updates the eslint-v9 fixture to use a typescript config
@react-sizebot
Copy link

react-sizebot commented Feb 22, 2025

Comparing: d55cc79...885e163

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.27 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 ecbb8e2

"eslint-plugin-react-hooks": "link:../../build/oss-stable/eslint-plugin-react-hooks"
"eslint": "^9.18.0",
"eslint-plugin-react-hooks": "link:../../build/oss-stable/eslint-plugin-react-hooks",
"jiti": "^2.4.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@poteto poteto marked this pull request as ready for review February 28, 2025 16:02
@poteto poteto merged commit ca12911 into facebook:main Feb 28, 2025
193 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 28, 2025
…onfig (#32457)

This change swaps which config `recommended` is aliasing. In 5.2.0, the
new flat config was introduced as `recommended-latest`, while
`recommended` still pointed at the legacy rc-based config, with a note
that in the next major version `recommended` would be updated to point
at `recommend-latest`. This change makes that swap, and make the default
`recommended` experience the flat config. To continue using the legacy
rc recommended config, please make the following change in your config

```diff
- extends: ['plugin:react-hooks/recommended']
+ extends: ['plugin:react-hooks/recommended-legacy']
```

This change also deprecates `recommended-latest` in favor of
`recommended`. `recommended-latest` will be removed in a future major
version.

The README has been updated to reflect the new usage, and to put the
flat config sections before the legacy config sections.

I also took the opportunity to change the v9 fixture to use a typescript
config, serving as a demonstration for usage as well as a way to
validate the types are correct.

BREAKING CHANGE

---------

Co-authored-by: lauren <poteto@users.noreply.github.com>

DiffTrain build for [ca12911](ca12911)
@michaelfaith michaelfaith deleted the feat/make-flat-config-recommended branch February 28, 2025 16:57
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.

4 participants