-
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
cliOptions.fix is ignored #58
Comments
I've also been unable to get the runner to actually fix the files, I can see that auto fix is enabled with the output Running eslint --fix separately does fix the file however. package versions
# test output
8:21 error There should be no space before ',' comma-spacing
✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 0.038 s
Ran all test suites related to changed files.
Watch Usage
› Press a to run all tests.
› Press f to quit "only failed tests" mode.
› Press p to filter by a filename regex pattern.
› Press t to filter by a test name regex pattern.
› Press q to quit watch mode.
› Press F to toggle ESLint --fix (enabled).
› Press i to run failing tests interactively.
› Press Enter to trigger a test run. // jest.config.js
//....
watchPlugins: ['jest-runner-eslint/watch-fix'],
projects: [
{
displayName: 'test'
},
{
runner: 'jest-runner-eslint',
displayName: 'lint',
testMatch: ['<rootDir>/src/**/*']
}
]
//... // package.json
...
"jest-runner-eslint": {
"cliOptions": {
"fix":true
}
}
... |
So the reason for this lies here: jest-runner-eslint/src/runner/runESLint.js Lines 106 to 110 in 4dedcc3
When you’re outside of the watch mode, jest-runner-eslint/src/runner/index.js Lines 4 to 6 in 4dedcc3
That So, basically, we’re always overriding the correct The fix would be to omit |
Dunno what the workaround could be, though. I tried doing // jest-runner-eslint.config.js
const configOverrides = require('jest-runner-eslint/build/utils/configOverrides')
configOverrides.getFix = () => true but that didn’t help. |
The config is taken into account since strict override works, but it still does not fix and shows the following:
The text was updated successfully, but these errors were encountered: