-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Rename typingOptions.enableAutoDiscovery to typeAcquisition.enable #12373
Conversation
3bae217
to
5a9451a
Compare
@@ -996,9 +996,9 @@ namespace ts { | |||
return { options, errors }; | |||
} | |||
|
|||
export function convertTypingOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: TypingOptions, errors: Diagnostic[] } { | |||
export function convertTypeAcquisitionFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: TypeAcquisition, errors: Diagnostic[] } { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question to @mhegazy - do we consider this a breaking change since this API was public in 2.0. this is also related to name of section in config file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we never documented it intentionally , i would say. so it is a breaking change, but not one that would impact ppl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding support for the deprecated API (typingOptions.enableAutoDiscovery) just in case
8a52f05
to
70e130b
Compare
raw: json, | ||
errors: [createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> "))], | ||
wildcardDirectories: {} | ||
}; | ||
} | ||
|
||
let options: CompilerOptions = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName); | ||
const typingOptions: TypingOptions = convertTypingOptionsFromJsonWorker(json["typingOptions"], basePath, errors, configFileName); | ||
// typingOptions has been deprecated. Use typeAcquisition instead. | ||
const jsonOptions = json["typeAcquisition"] || json["typingOptions"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment that we support typingOptions
only for backward compat purposes and should remove it in a couple of releases
basePath: string, errors: Diagnostic[], configFileName?: string): TypeAcquisition { | ||
|
||
const options: TypeAcquisition = { enable: getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; | ||
replaceEnableAutoDiscoveryWithEnable(jsonOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should mangle input argument, user code might rely on properties to exist
// Replace deprecated typingOptions.enableAutoDiscovery with typeAcquisition.enable | ||
export function convertEnableAutoDiscoveryToEnable(typeAcquisition: TypeAcquisition): TypeAcquisition { | ||
// Convert deprecated typingOptions.enableAutoDiscovery to typeAcquisition.enable | ||
const result = typeAcquisition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is effectively an alias, so any modifications on result
will affect source typeAcquisition
object
ba0a6e9
to
a0ec828
Compare
a0ec828
to
2b89d91
Compare
Rename typingOptions.enableAutoDiscovery to typeAcquisition.enable