-
Notifications
You must be signed in to change notification settings - Fork 12.9k
fix(37578): Deprecate variable name AllowQualifedNameInPlaceOfIdentifier #38726
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(37578): Deprecate variable name AllowQualifedNameInPlaceOfIdentifier #38726
Conversation
…lifiedNameInPlaceOfIdentifier
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.
In #37578 I asked to deprecate misspelled variable instead of removing it, as it may break backward-compatibility (in linters, etc.)
It was previously done here, for example:
TypeScript/src/compiler/types.ts
Lines 3380 to 3381 in a1c8608
/** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */ | |
ProjectReferenceCycle_OutputsSkupped = 4, |
@@ -3691,7 +3691,7 @@ namespace ts { | |||
|
|||
// Error handling | |||
AllowThisInObjectLiteral = 1 << 15, | |||
AllowQualifedNameInPlaceOfIdentifier = 1 << 16, | |||
AllowQualifiedNameInPlaceOfIdentifier = 1 << 16, |
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.
In #37578 I asked to deprecate misspelled variable instead of removing it, as it may break backward-compatibility (in linters, etc.)
It was previously done here, for example:
TypeScript/src/compiler/types.ts
Lines 3380 to 3381 in a1c8608
/** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */ | |
ProjectReferenceCycle_OutputsSkupped = 4, |
What do you think about it?
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.
Oh yeah, that sounds much better than deleting it. I just updated my code to deprecate it instead.
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.
LGTM!
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.
Thanks for this fix. I requested one minor change; if you no longer have time for it, let me know and I'll try to get to it myself.
@@ -5366,6 +5366,7 @@ namespace ts { | |||
|
|||
if (expectsIdentifier && chain.length !== 1 | |||
&& !context.encounteredError | |||
&& !(context.flags & NodeBuilderFlags.AllowQualifiedNameInPlaceOfIdentifier) | |||
&& !(context.flags & NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) { |
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.
the new value is the same as the old, so you should replace the old usage instead of adding to it.
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.
Fixed
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.
Couple more things I noticed
src/compiler/types.ts
Outdated
@@ -3702,7 +3704,7 @@ namespace ts { | |||
AllowNodeModulesRelativePaths = 1 << 26, | |||
/* @internal */ DoNotIncludeSymbolChain = 1 << 27, // Skip looking up and printing an accessible symbol chain | |||
|
|||
IgnoreErrors = AllowThisInObjectLiteral | AllowQualifedNameInPlaceOfIdentifier | AllowAnonymousIdentifier | AllowEmptyUnionOrIntersection | AllowEmptyTuple | AllowEmptyIndexInfoType | AllowNodeModulesRelativePaths, | |||
IgnoreErrors = AllowThisInObjectLiteral | AllowQualifedNameInPlaceOfIdentifier | AllowQualifiedNameInPlaceOfIdentifier | AllowAnonymousIdentifier | AllowEmptyUnionOrIntersection | AllowEmptyTuple | AllowEmptyIndexInfoType | AllowNodeModulesRelativePaths, |
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.
same here -- replace the old
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.
Fixed
src/compiler/types.ts
Outdated
@@ -3691,6 +3691,8 @@ namespace ts { | |||
|
|||
// Error handling | |||
AllowThisInObjectLiteral = 1 << 15, | |||
AllowQualifiedNameInPlaceOfIdentifier = 1 << 16, | |||
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */ | |||
AllowQualifedNameInPlaceOfIdentifier = 1 << 16, |
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.
please replace 1 << 16
with AllowQualifiedNameInPlaceOfIdentifier
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.
Fixed
@sandersn Thanks! I will make those changes |
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'll merge this after 4.1 RC gets its own branch, so that it'll ship in 4.1.
Description:
Change variable name AllowQualifedNameInPlaceOfIdentifier to AllowQualifiedNameInPlaceOfIdentifier
Bug introduced in: #14709
Expected behavior:
AllowQualifedNameInPlaceOfIdentifier should be deprecated in favor of AllowQualifiedNameInPlaceOfIdentifier
Actual behavior:
AllowQualifedNameInPlaceOfIdentifier is not deprecated
Fixes #37578