-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Rename typingOptions.enableAutoDiscovery to typeAcquisition.enable #12373
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
Conversation
3bae217 to
5a9451a
Compare
| } | ||
|
|
||
| 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
| const typingOptions: TypingOptions = convertTypingOptionsFromJsonWorker(json["typingOptions"], basePath, errors, configFileName); | ||
| // typingOptions has been deprecated. Use typeAcquisition instead. | ||
| const jsonOptions = json["typeAcquisition"] || json["typingOptions"]; | ||
| const typeAcquisition: TypeAcquisition = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); |
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
src/compiler/commandLineParser.ts
Outdated
|
|
||
| const options: TypeAcquisition = { enable: getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; | ||
| replaceEnableAutoDiscoveryWithEnable(jsonOptions); | ||
| convertOptionsFromJson(typeAcquisitionDeclarations, jsonOptions, basePath, options, Diagnostics.Unknown_type_acquisition_option_0, errors); |
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
src/compiler/commandLineParser.ts
Outdated
| // 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