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
[allowAutomaticSingleRunInference] auto fix mangles files #3626
Comments
@JamesHenry - interesting.
Which means ofc that the program gets reused. |
Ah damn, that does make sense. I'm not sure there is a way to retain the wins of AOT compilation of Programs and the correct functionality of |
If they're running @uniqueiniquity - do you know of a good way for us to solve this? |
Yeah that's specifically what the watch program is giving us - the ability to incrementally update the program in memory. |
@bradzacher @uniqueiniquity I have added a fix for this issues here: I realise this isn't the most sophisticated fix (and we can improve this further in the future by adding support for the catch-all builder program as we discussed as part of the long-term solution to createDefaultProgram) but for now this at least makes singleRun mode usable with --fix and in my basic testing locally it still yields a speed up over the same invocation without singleRun mode enabled. |
Repro
The repro picks a fixable rule, violates that rule in 5 identical files, then runs
eslint --fix
on them with an.eslintrc
that specifies"allowAutomaticSingleRunInference": true
. I happened to first run into this withconsistent-type-imports
but I've reproduced it with other autofix rules.https://github.com/bhollis/allowAutomaticSingleRunInference-repro
Expected Result
Actual Result
The mangling isn't always a repetition like this.
Versions
@typescript-eslint/eslint-plugin
4.28.2
@typescript-eslint/parser
4.28.2
TypeScript
4.3.5
ESLint
7.30.0
node
v16.3.0
Additional Info
Output of "eslint --fix . --ext .ts --debug"
The text was updated successfully, but these errors were encountered: