WP-Scripts: Do not apply jest eslint rules if cypress is installed. #42952
Labels
Good First Issue
An issue that's suitable for someone looking to contribute for the first time
Needs Dev
Ready for, and needs developer efforts
[Package] ESLint plugin
/packages/eslint-plugin
[Package] Scripts
/packages/scripts
Projects
What problem does this address?
Using WP-Scripts in combination with Cypress for E2E testing will result in false positives for Jest related rules as the Jest config is unable to pick up Cypress assertions.
What is your proposed solution?
Test for Cypress and disable to Jest rules if the package is installed. This is a similar approach to that taken for Playwrite
gutenberg/packages/eslint-plugin/configs/recommended-with-formatting.js
Lines 49 to 52 in 88899c8
Alternative
A configuration option in
package.json
oreslintrc.json
to prevent the Jest config from being included. This will allow the package to be managed generally rather than via snowflake rules for various set ups.For the time being I have added the following to my config file but it doesn't seem optimal:
The text was updated successfully, but these errors were encountered: