Skip to content

Commit

Permalink
eslint: Enable more react rules (#39421)
Browse files Browse the repository at this point in the history
* `react-hooks/exhaustive-deps`: Apply to `useSelect`.
* `react/no-direct-mutation-state`
* `react/no-find-dom-node`
* `react/no-unescaped-entities`

The first of those accounts for the majority of fixes in this PR, we had
a bunch of places either missing a dependency or specifying a dependency
unnecessarily. Of particular note is that constants defined outside of
the `render()` function, like `STORE_ID`, don't need to be dependencies.

Of the rest, `react/no-direct-mutation-state` was only violated in one
place, `react/no-unescaped-entities` in one storybook story, and
`react/no-find-dom-node` was already fixed everywhere.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11261999141

Upstream-Ref: Automattic/jetpack@f2c8bd3
  • Loading branch information
anomiex authored and matticbot committed Oct 9, 2024
1 parent 1fd79cc commit 0a74f32
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'fcc8e88b11fcc1dfd63b');
<?php return array('dependencies' => array('jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'ad66694505b56e5daaf7');

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'bdea5410a1ec79f76713');
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'a00dd480dcda312e75e8');

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'ad6bb269df6cbb75fd84');
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'react', 'react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '12affa0b12fd7b5a0a81');

Large diffs are not rendered by default.

0 comments on commit 0a74f32

Please sign in to comment.