-
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: Use Jest related rules only when the package is installed #33120
Conversation
Size Change: 0 B Total Size: 1.04 MB ℹ️ View Unchanged
|
We include all the rules for tests in the recommended config in this place:
If there is no Jest installed, then probably there are no tests so we could as well ignore all those overrides. Rather than enforcing Jest as a dependency, we could ignore all Jest related rules if there is no Jest. We have a similar approach for TypeScript:
What do you think about using the same technique instead? |
8ce795f
to
3d1f22f
Compare
@psealock, thank you for raising this issue and proposing the initial implementation 👍🏻 |
* trunk: [RNMobile][Embed block] Add device's locale to preview content (#33858) Update AlignmentMatrixControl docs post merge. (#34662) Chore: Update caniuse package to the latest version (#34685) Chore: Move `react-native-url-polyfill` to dev dependencies (#34687) Site Editor - add basic plugin support (#34460) ESLint Plugin: Use Jest related rules only when the package is installed (#33120) Update `@wordpress/components` package's contributing guidelines (#33960) chore(release): publish Update changelog files [RNMobile] [Embed block] Fix content disappearing on Android when switching light/dark mode (#34207) Scripts: Convert legacy entry point arguments for compatibility with webpack 5 (#34264) Update justication control in `flex` layout (#34651) Block Editor: Rename experimental prop used in `BlockControls` (#34644) Fix social links deprecation (#34639)
Description
Using
@wordpress/eslint-plugin
on its own produces an error:How has this been tested?
package.json
test.js
file with some violationsnpm install
./node_modules/.bin/eslint test.js
. This fails and you should see the error. It can be fixed by installing Jest.Types of changes
Dependency declaration for
@wordpress/eslint-plugin
Checklist:
*.native.js
files for terms that need renaming or removal).