-
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
(Ideally) Fail on Fixed Linter Errors #44
Comments
In jest-runner-eslint/src/runESLint.js Lines 21 to 38 in e6ad060
a fix, I believe, can be detected with |
I'm confused; if you want it to fail on things that are autofixed, can you not disable autofix in CI? |
Specifically, you can use two separate jest commands, pointing to separate configs, one for CI and one for local. |
Thanks for reporting! Let me make sure that I correctly understood the problem. You want You can add a config file for this runner module.exports = {
cliOptions: {
fix: !process.env.IS_CI
}
} |
As @ljharb mentioned, having two separate configs is also a good option for achieving this. |
@ljharb To be honest, I haven't had much experience with I've set it up so that I have separate current lint jest config:
However, @rogeliog 's solution seems actionable. |
Since I'm satisfied that I have a good way forward, I'm going to close the issue. However, I'm still interested how one would go about having two separate |
I think once jestjs/jest#4278 happens, it should eliminate the need for the separate config file. |
My team is using this runner to lint our app. We have the linter called by individual developers and our CI.
When it's an individual developer, we want to auto-fix any linter issues it comes across (we usually do this before merging). We don't mind re-doing the linter to get all green. (We have to do the same with ruby / rubocop.)
For the CI, though, we want it to fail / terminate, so that the imperfect code doesn't propagate through our pipeline.
Thoughts:
(1) If it could just fail whenever a linter issue is autofixed, then there's no problem.
(2) If I could have separate configurations of the runner (fix and not to fix), then that'd also address it.
The text was updated successfully, but these errors were encountered: