Do you want to request a feature or report a bug?
Feature.
When running Jest with jest-runner-eslint in watch mode, I'm often presented with this:

Note that the plugin (via the ESLint default formatter) suggests passing --fix to correct this error. This is true if you are using the ESLint CLI, but as this workflow integrates deeply with Jest, you either need to:
- Run the runner with a separate configuration for "fixing" code.
(e.g. jest -c jest.eslint-fix.config.js)
- Run
eslint . --fix separately. (Which may require re-stating CLI flags such as --ignore-path)
Neither of these workflows are particularly nice.
There are two possible solutions that I can think of:
- Overload the
-u key to update the file instead of the snapshot.
- Allow the runner to contribute new commands.
A quick sketch of what the latter might look like follows:
Runner API Sketch
onResult(test, {
...testResult,
commands: [{
key: 'f',
description: 'run eslint --fix',
action: () => {
fix(test.name);
}
}]
});
CLI Usage
jest --executeRunnerCommands f -c jest.eslint.config.js
--watch Usage
› Press f to run eslint --fix
Thoughts on this workflow?
Do you want to request a feature or report a bug?
Feature.
When running Jest with
jest-runner-eslintin watch mode, I'm often presented with this:Note that the plugin (via the ESLint default formatter) suggests passing
--fixto correct this error. This is true if you are using the ESLint CLI, but as this workflow integrates deeply with Jest, you either need to:(e.g.
jest -c jest.eslint-fix.config.js)eslint . --fixseparately. (Which may require re-stating CLI flags such as--ignore-path)Neither of these workflows are particularly nice.
There are two possible solutions that I can think of:
-ukey to update the file instead of the snapshot.A quick sketch of what the latter might look like follows:
Runner API Sketch
CLI Usage
--watchUsageThoughts on this workflow?