Skip to content

[Bug]: eslint-plugin-react-hooks documentation says that 2 rules are recommended and all others are opt-in but that's not true #8066

@thobas-dnvgl

Description

@thobas-dnvgl

Summary

https://react.dev/reference/eslint-plugin-react-hooks says:

Starting in version 6.0, these rules are available to opt-in:
...

According to that page only exhaustive-deps and rules-of-hooks are recommended.

But if you look are the source code for 7.0, you can see that extending configs.flat.recommended will more or less enable ALL the rules, including the ones related to the compiler:

https://github.com/facebook/react/blob/4b3e662e4ce54eb54a8701c48a967cc84a389501/packages/eslint-plugin-react-hooks/src/index.ts#L49-L52

Either the documentation needs to be updated or there is a bug in eslint-plugin-react-hooks where the recommended flat configs enabled too many rules. I am not in a position to decide who is wrong here :).

Page

https://react.dev/reference/eslint-plugin-react-hooks

Details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions