-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Enhancement: Allow project service to provide type information for out-of-project files #7871
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
Comments
Definitely want to do perf testing here to make sure that this actually the case. |
Would need to dig into it but in the past when I've looked it seemed like the only way to have an "mutable" program that allows you to change things like adding files or changing contents was a builder program. So I'd assume that the language service uses a builder program as it's backing tooling so that it can mutate the program in response to the IDE changes. Maybe it uses something else? Some backstory into past perf work: Since the genesis of type-aware linting we have used a builder program in the parser. Eventually we found (or rather Ben Lichtman first discovered) that if you passed a plain old Ben had a usecase at MSFT iirc where he'd already generated a Profiling lead us to determine that essentially when you ask the builder to provide you with the latest program it had to do a bunch of work to check for changes and such before it could give you the James prototyped a solution that created a |
Marking as accepted as a follow-up to #7761 (comment): that we could take in fallback out-of-project file support. As in, for the specific case of some random root-ish-level config file ( That's not the same as allowing out-of-project file information by default - even with |
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
typescript-estree
My proposal is suitable for this project
Description
Splitting out of #7435: that issue indicates that the error message for trying to generate type information for a file not recognized by the
tsconfig.json
is not ideal. But as we see in #7752, if we don't check to make sure that the file is recognized... type information still works! This issue tracks: can we allow "unknown" (not included in the TSConfig) files to have type info generated by the project service?Not needing to explicitly include files in the TSConfig would be ideal from the perspective of simple configs. It'd mean we can get rid of
tsconfig.eslint.json
-style strategies of having a different TSConfig for your linted code. Those are commonly used to enableallowJs
for root-level config files (e.g.eslint.config.js
) not included in the project's TS-onlytsconfig.json
.We can't enable that kind of "config-less typed JS linting" with traditional
project: true
styles of approaches because of the following combination of tech restrictions:DEPRECATED__createDefaultProgram
in v6 is known to cause significant slowdowns in non-trivial usesIf we can use the project service in a way that doesn't suffer from the same drawback, then that'd be a massive win for users.
Additional Info
Shoutout+thanks as always @jakebailey for helping us with the TypeScript side!
The text was updated successfully, but these errors were encountered: