-
Notifications
You must be signed in to change notification settings - Fork 800
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
js-tools: Add missing eslint plugin dep #21642
Conversation
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.
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. |
Great news! One last step: head over to your WordPress.com diff, D69608-code, and commit it. Thank you! |
r234525-wpcom |
# By Brad Jorsch (2) and others # Via GitHub * master: Boost: Fix the official name to the JavaScript word reference (#21638) tools: Allow extra spaces in next-version tags (#21647) Publicize: always add an alt text to Open Graph Images (#21520) js-tools: Add missing eslint plugin dep (#21642) * Deactivate SSO in e2e environment (#21644) Publicize: Handling feature availability information and upgrading (#21567) Nav Unification: Remove `preferred-view` param after update (#21632) [Plugin] Backup: Update/upgrade button link (#21590) # Conflicts: # projects/plugins/boost/app/assets/src/js/pages/settings/sections/Modules.svelte
* master: (24 commits) Update dependency preact to v10.5.15 (#21635) Search: Migrate helper classes to standalone package (#21552) Release script: fix small typo (#21675) Update babel monorepo (#21668) Lock file maintenance (#21664) E2E tests: clean unused dependencies (#21639) Create JS Config package (#21592) Use webpack config JS package in Jetpack (#21581) add test runner to dev dependencies (#21591) Pexels Integration: Make the initial image search for example query run only once (#21641) Boost: make progress bar corners round on small screens (#21626) Full Sync :: limit to contributors and above (#21648) Sync Checksums : limit users based on user_level (#21645) Storybook: add Jetpack Spinner (#21511) Contact Info and Map widget: widget deprecation (#21554) Use webpack config js package in everything except Jetpack (#21580) Boost: Fix the official name to the JavaScript word reference (#21638) tools: Allow extra spaces in next-version tags (#21647) Publicize: always add an alt text to Open Graph Images (#21520) js-tools: Add missing eslint plugin dep (#21642) ...
Changes proposed in this Pull Request:
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
thateven 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 nolonger 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 wehave things set up.
Jetpack product discussion
p1635982454440000-slack-CBG1CP4EN
Does this pull request change what data or activity we track or use?
No
Testing instructions:
git checkout 8cd0bd281db6d01e8fc73f2aeb59d6f4175221eb
(from Display notice when user has unactivated product license keys #21474)pnpm install
pnpx eslint-changed --ext .js,.jsx,.cjs,.mjs,.ts,.tsx --git "--git-base=f6bb136d3c6101589303a4686a80851065fca426" projects/plugins/jetpack/_inc/client/state/licensing/reducer.js
git cherry-pick fix/missing-eslint-plugin-dep
pnpm install
pnpx eslint-changed --ext .js,.jsx,.cjs,.mjs,.ts,.tsx --git "--git-base=f6bb136d3c6101589303a4686a80851065fca426" projects/plugins/jetpack/_inc/client/state/licensing/reducer.js