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

**Major** Add react-hooks lint rules to react rules #131

Merged
merged 7 commits into from
Apr 16, 2021

Conversation

msluther
Copy link
Contributor

The react-hooks rules catch lots of errors when using useMemo/useEffect/useCallback especially around the dependency arrays. e.g.

  35:6  warning  React Hook useEffect has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the useEffect call and refer to those specific props inside useEffect  react-hooks/exhaustive-deps
  35:6  warning  React Hook useEffect has a missing dependency: 'foo'. Either include it or remove the dependency array.   react-hooks/exhaustive-deps

But, because we would be including new rules, this should go out as a new Major release for the react* rules.

Copy link

@DullReferenceException DullReferenceException left a comment

Choose a reason for hiding this comment

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

💯

Copy link

@twyrick-godaddy twyrick-godaddy left a comment

Choose a reason for hiding this comment

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

👍

@DullReferenceException
Copy link

:shipit:

@rxmarbles
Copy link
Member

Will merge it now and ship later tonight

@rxmarbles rxmarbles merged commit 61e0ba9 into main Apr 16, 2021
@rxmarbles rxmarbles deleted the add-react-hooks-rules branch April 16, 2021 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants