-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 flag doesn't work with custom Program #3834
Comments
This is just a limitation of this custom program infra. It was designed for a very specific use-case (some teams in microsoft linting using custom tooling which already had a program instance), and thus was not designed to handle all cases fully. With the current API - I don't think that it's possible for us to allow you to provide a custom program AND also allow the system to reactively handle the fix usecase AND also handle the IDE watch usecase. In a nutshell - we would have to completely redesign the API to take a function which generates programs so that we can regenerate programs on-the-fly when we think we might need to. |
Got it. I originally faced this issue while trying to work around #3798, do you have any insights there? If by any chance you could ping someone from the TS team that you might have a closer contact it'd be great. I was thinking of duplicating in the TS repo to have better chances of getting an answer from them as well because the issue is pretty much TS-related. |
Same as #3798 (comment), sadly. |
I originally reported this as I wanted a workaround for #3798 so by having a custom program I could run the suite faster, now that there's a solution there, if we allow an option parserOptions.hasInvalidatedResolutions to be provided and plug it into the compiler host it should be enough—at least for me use case, although it's not a solution to the original issue I reported (-"-fix doesn't work with a custom Program"). |
Repro
Expected Result
Actual Result
Additional Info
I saw that the
allowAutomaticSingleRunInference
added a workaround for this by checking if a file has been called inside theparserAndGenerateServices
more than once, but unfortunately, there's no way for me to access that from the ESLint config file just. This really limits the usage of the custom Programs functionality if someone relies on the--fix
flag.Versions
@typescript-eslint/typescript-estree
4.29.3
TypeScript
4.3.2
node
4.17.0
The text was updated successfully, but these errors were encountered: