-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ESLint Plugin: Remove all rules targeting test files from recommended presets #43272
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gziolo
requested review from
ntwb,
nerrad,
ajitbohra,
ryanwelcher and
ellatrix
as code owners
August 16, 2022 12:51
gziolo
changed the title
ESLint Plugin: Remove all rules targeting test files from recommended…
ESLint Plugin: Remove all rules targeting test files from recommended presets
Aug 16, 2022
gziolo
added
[Tool] ESLint plugin
/packages/eslint-plugin
[Tool] WP Scripts
/packages/scripts
[Type] Breaking Change
For PRs that introduce a change that will break existing functionality
labels
Aug 16, 2022
gziolo
force-pushed
the
update/eslint-plugin-tests
branch
from
August 16, 2022 12:54
3ac7508
to
d5bd0e4
Compare
Size Change: 0 B Total Size: 1.24 MB ℹ️ View Unchanged
|
peterwilsoncc
approved these changes
Aug 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed with white space suppressed --- LGTM, thank you.
✅ Rules are included in the Gutenberg root directory's config file so will continue to apply to this repo.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Tool] ESLint plugin
/packages/eslint-plugin
[Tool] WP Scripts
/packages/scripts
[Type] Breaking Change
For PRs that introduce a change that will break existing functionality
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Follow up for #38570.
Fixes #42952.
This PR ensures that rules for e2e tests are no longer applied by default when using the recommended config from
@wordpress/eslint-plugin
or with@wordpress/scripts
. We are in the transition phase where both Playwright and Puppeteer are in use. In addition to that, the old config conflicts in the project that use different tooling like Cypress.Why?
From #42952.
How?
I removed all rules covering Jest test framework from the recommended settings in
@wordpress/eslint-plugin
:recommended
andrecommended-with-formatting
.I expanded the existing documentation in the README file in
@wordpress/eslint-plugin
for the rulesets in case someone wants to enable those rules in their project.I ensured that rules for unit tests are enabled by default in WP projects only when using
@wordpress/scripts
. This avoids conflicts with tests written for the Playwright in the Gutenberg plugin that match the same pattern.