-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fix toggle not working in projects config #86
Comments
I think I've seen something similar before in jest. If you have a configuration with a unit test runner and a lint runner (like the one above), you need to specify module.exports = {
collectCoverage: true,
projects: [
{
displayName: 'test',
collectCoverage: true,
},
{
runner: 'jest-runner-eslint',
displayName: 'lint',
testMatch: ['<rootDir>/src/**/*.js'],
watchPlugins: ["jest-runner-eslint/watch-fix"],
},
],
}; Based on this, I suspect that the following should work to enable the watch plugin: module.exports = {
watchPlugins: ["jest-runner-eslint/watch-fix"],
projects: [
{
displayName: 'test',
},
{
runner: 'jest-runner-eslint',
displayName: 'lint',
testMatch: ['<rootDir>/src/**/*.js'],
watchPlugins: ["jest-runner-eslint/watch-fix"],
},
],
}; |
Nice, I've just tried your solution and it works. Interestingly, it also work if you only specify the
|
I believe this is due to the distinction between global config and project config. Properties that come from the global config are only valid at the top level, whereas properties from the project config are only valid at the project level. This isn't mentioned in the docs, but can be seen in the type definitions. |
This commit fixes the bug described in jest-community/jest-runner-eslint#86 by implementing the solution proposed by: jest-community/jest-runner-eslint#86 (comment)
✔️
When using a basic jest config the
Press F to override ESLint --fix
works as expected.✖️
When using a projects configuration the
Press F to override ESLint --fix
does not work.The text was updated successfully, but these errors were encountered: