Skip to content

Commit

Permalink
js-tools: Add missing eslint plugin dep (#21642)
Browse files Browse the repository at this point in the history
Eslint "sharable configs" are supposed to peer-depend on any plugins
they need. But people usually forget this because npm hoisting makes it
usually work anyway.

In this case, eslint-config-wpcalypso was missing a peer dep on
eslint-plugin-react-hooks.

This happened to work before because eslint-changed was shelling out to
eslint, which runs from `node_modules/.pnpm/eslint@7.32.0/node_modules/eslint`,
which was picking up the dep from `node_modules/.pnpm/node_modules` that
even pnpm puts in place to handle crap like this.

When #21606 switched eslint-changed to use eslint's API instead of
shelling out, it doesn't run from within `node_modules/.pnpm/` anymore
(because eslint-changed is in the monorepo), so
`node_modules/.pnpm/node_modules` is no longer in node's path, so it no
longer would find the plugin.

The solution is to add the missing plugin to js-tools's deps, because
`tools/js-tools/node_modules` will still be in the path with the way we
have things set up.
  • Loading branch information
anomiex authored Nov 4, 2021
1 parent 41fa480 commit 42fb814
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tools/js-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"eslint-plugin-lodash": "7.3.0",
"eslint-plugin-prettier": "3.4.1",
"eslint-plugin-react": "7.26.1",
"eslint-plugin-react-hooks": "4.2.0",
"eslint-plugin-wpcalypso": "5.0.0",
"glob": "7.1.6",
"ignore": "5.1.8",
Expand Down

0 comments on commit 42fb814

Please sign in to comment.