Closed as not planned
Closed as not planned
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
Relevant Package
parser
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
I've heard of two requests around EXPERIMENTAL_useProjectService
:
- Customize the default options in the case of a
tsconfig.json
not existing: https://discord.com/channels/508357248330760243/640177429775777792/1163326359100199012 - Warn if it's being used: feat(typescript-estree): add allowDefaultProjectForFiles project service allowlist option #7752 (comment)
These are technically two requests, but I think it'd be good to discuss them together. Whatever API we end up going with may need to accommodate both.
Proposal: how about a fallbackCompilerOptions
?
type FallbackCompilerOptions =
/* Don't allow fallback/inferred projects at all */
| "error"
/* Allow fallback/inferred projects but log a warning */
| "warn"
/* Directly use these */
ts.CompilerOptions;
// (approximation of the shape we'd allow)
interface ProjectServiceParserOptions {
EXPERIMENTAL_useProjectService: true;
// If undefined, go with TypeScript's defaults
fallbackCompilerOptions?: FallbackCompilerOptions;
}
Additional Info
Courtesy of @jakebailey in https://discord.com/channels/508357248330760243/1163326359100199012/1163526441103802398: project services have a setCompilerOptionsForInferredProjects
we can use.
#7752 largely enables the case of an inferred project in the first place.
Edit: oh, and also mentioned here: #6575 (comment)