Skip to content

Commit

Permalink
Enable react-hooks/exhaustive-deps eslint rules (#24914)
Browse files Browse the repository at this point in the history
* Upgrade eslint and eslint-plugin-react-hooks and enable exhaustive-deps

* Add CHANGELOG entry

* Update changelog with more detail

* Alphabetise hooks

* Remove accidental prettier dep change introduced via rebase

---------

Co-authored-by: Dave Smith <444434+getdave@users.noreply.github.com>
Co-authored-by: Marin Atanasov <8436925+tyxla@users.noreply.github.com>
Co-authored-by: Marco Ciampini <1083581+ciampo@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 9, 2023
1 parent b9722b5 commit 5bd27ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/eslint-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## 13.10.0 (2023-02-01)

- The bundled `eslint-plugin-jsdoc` dependency has been updated from requiring `^37.0.3` to requiring `^39.6.9`
- The bundled `eslint-plugin-jsdoc` dependency has been updated from requiring `^37.0.3` to requiring `^39.6.9`

### Enhancement

Expand Down Expand Up @@ -171,6 +171,10 @@
- The bundled `eslint-plugin-react` dependency has been updated from requiring `^7.20.0` to requiring `^7.22.0` ([#27965](https://github.com/WordPress/gutenberg/pull/27965)).
- The bundled `eslint-plugin-react-hooks` dependency has been updated from requiring `^4.0.4` to requiring `^4.2.0` ([#27965](https://github.com/WordPress/gutenberg/pull/27965)).

### New Features

- Enable `react-hooks/exhaustive-deps` rules in the react config in "warn" mode ([#24914](https://github.com/WordPress/gutenberg/pull/24914)).

## 7.4.0 (2020-12-17)

### New Feature
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/configs/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
'react/no-children-prop': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
},
};

1 comment on commit 5bd27ba

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 5bd27ba.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4136214875
📝 Reported issues:

Please sign in to comment.