react/packages/eslint-plugin-react-hooks/CHANGELOG.md
lauren 7568e71854
[eprh] Prepare for 7.0.0 (#34757)
For 7.0.0:

Slim down presets to just 2 configurations:

- `recommended`: legacy and flat config with all recommended rules, and
- `recommended-latest`: legacy and flat config with all recommended
rules plus new bleeding edge experimental compiler rules

Removed:
- `recommended-latest-legacy`
- `flat/recommended`

Please see the README for new install instructions.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34757).
* #34783
* #34782
* __->__ #34757
2025-10-08 15:17:31 -04:00

13 KiB
Raw Blame History

7.0.0

This release slims down presets to just 2 configurations (recommended and recommended-latest), and all compiler rules are enabled by default.

  • Breaking: Removed recommended-latest-legacy and flat/recommended configs. The plugin now provides recommended (legacy and flat configs with all recommended rules), and recommended-latest (legacy and flat configs with all recommended rules plus new bleeding edge experimental compiler rules). (@poteto in #34757)

6.1.1

Note: 6.1.0 accidentally allowed use of recommended without flat config, causing errors when used with ESLint v9's defineConfig() helper. This has been fixed in 6.1.1.

  • Fix recommended config for flat config compatibility. The recommended config has been converted to flat config format. Non-flat config users should use recommended-legacy instead. (@poteto in #34700)
  • Add recommended-latest and recommended-latest-legacy configs that include React Compiler rules. (@poteto in #34675)
  • Remove unused NoUnusedOptOutDirectives rule. (@poteto in #34703)
  • Remove hermes-parser and dependency. (@poteto in #34719)
  • Remove @babel/plugin-proposal-private-methods dependency. (@ArnaudBarre and @josephsavona in #34715)
  • Update for Zod v3/v4 compatibility. (@kolian and @josephsavona in #34717)

6.1.0

Note: Version 6.0.0 was mistakenly released and immediately deprecated and untagged on npm. This is the first official 6.x major release and includes breaking changes.

  • Breaking: Require Node.js 18 or newer. (@michaelfaith in #32458)
  • Breaking: Flat config is now the default recommended preset. Legacy config moved to recommended-legacy. (@michaelfaith in #32457)
  • New Violations: Disallow calling use within try/catch blocks. (@poteto in #34040)
  • New Violations: Disallow calling useEffectEvent functions in arbitrary closures. (@jbrown215 in #33544)
  • Handle React.useEffect in addition to useEffect in rules-of-hooks. (@Ayc0 in #34076)
  • Added react-hooks settings config option that to accept additionalEffectHooks that are used across exhaustive-deps and rules-of-hooks rules. (@jbrown215) in #34497

6.0.0

Accidentally released. See 6.1.0 for the actual changes.

5.2.0

5.1.0

  • Add support for do/while loops (@tyxla in #28714)
  • Fix error when callback argument is an identifier with an as expression (@mskelton in #31119)

5.0.0

  • New Violations: Component names now need to start with an uppercase letter instead of a non-lowercase letter. This means _Button or _component are no longer valid. (@kassens) in #25162

4.6.0

4.5.0

  • Fix false positive error with large number of branches. (@scyron6 in #24287)

4.4.0

  • No changes, this was an automated release together with React 18.

4.3.0

4.2.0

  • No changes, this was an automated release together with React 17.

4.1.2

4.1.1

4.1.0

4.0.8

  • Fixes TypeScript typeof annotation to not be considered a dependency. (@delca85 in #19316)

4.0.7

4.0.6

4.0.5

  • Fix a crash when the dependency array has an empty element. (@yeonjuan in #19145)
  • Fix a false positive warning that occurs with optional chaining. (@fredvollmer in #19061)

4.0.4

4.0.3

  • Remove the heuristic that checks all Hooks ending with Effect due to too many false positives. (@gaearon in #19004)

4.0.2

  • Prevent Hooks that have Effect in the middle from being considered effects. (@surgeboris in #18907)

4.0.1

4.0.0

  • New Violations: Consider PascalCase.useFoo() calls as Hooks. (@cyan33 in #18722)
  • New Violations: Check callback body when it's not written inline. (@gaearon in #18435)
  • New Violations: Check dependencies for all Hooks ending with Effect. (@airjp73 in #18580)
  • Add a way to enable the dangerous autofix. (@gaearon in #18437)
  • Offer a more sensible suggestion when encountering an assignment. (@Zzzen in #16784)
  • Consider TypeScript casts of useRef as constant. (@sophiebits in #18496)
  • Add documentation. (@ghmcadams in #16607)

3.0.0

2.5.0

2.4.0

  • New Violations: Run checks for functions passed to forwardRef. (@dprgarner in #17255)
  • New Violations: Check for ref usage in any Hook containing the word Effect. (@gaearon in #17663)
  • Disable dangerous autofix and use ESLint Suggestions API instead. (@wdoug in #17385)

2.0.0

1.x

The 1.x releases arent noted in this changelog, but you can find them in the commit history.