Skip to content

fix(37578): Deprecate variable name AllowQualifedNameInPlaceOfIdentifier#38726

Merged
sandersn merged 4 commits intomicrosoft:masterfrom
cljazouli:Rename-variable-AllowQualifedNameInPlaceOfIdentifier-Typo
Feb 17, 2021
Merged

fix(37578): Deprecate variable name AllowQualifedNameInPlaceOfIdentifier#38726
sandersn merged 4 commits intomicrosoft:masterfrom
cljazouli:Rename-variable-AllowQualifedNameInPlaceOfIdentifier-Typo

Conversation

@cljazouli
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

@Maxim-Mazurok Maxim-Mazurok left a 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:

/** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */
ProjectReferenceCycle_OutputsSkupped = 4,

Comment thread src/compiler/types.ts
// Error handling
AllowThisInObjectLiteral = 1 << 15,
AllowQualifedNameInPlaceOfIdentifier = 1 << 16,
AllowQualifiedNameInPlaceOfIdentifier = 1 << 16,
Copy link
Copy Markdown

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:

/** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */
ProjectReferenceCycle_OutputsSkupped = 4,

What do you think about it?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown

@Maxim-Mazurok Maxim-Mazurok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cljazouli cljazouli changed the title Change variable name AllowQualifedNameInPlaceOfIdentifier to AllowQua… fix(37578): Deprecate variable name AllowQualifedNameInPlaceOfIdentifier May 29, 2020
@cljazouli
Copy link
Copy Markdown
Contributor Author

cc @RyanCavanaugh

Copy link
Copy Markdown
Member

@sandersn sandersn left a 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.

Comment thread src/compiler/checker.ts Outdated
if (expectsIdentifier && chain.length !== 1
&& !context.encounteredError
&& !(context.flags & NodeBuilderFlags.AllowQualifiedNameInPlaceOfIdentifier)
&& !(context.flags & NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) {
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Copy Markdown
Member

@sandersn sandersn left a 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

Comment thread src/compiler/types.ts Outdated
/* @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,
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment thread src/compiler/types.ts Outdated
AllowThisInObjectLiteral = 1 << 15,
AllowQualifiedNameInPlaceOfIdentifier = 1 << 16,
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
AllowQualifedNameInPlaceOfIdentifier = 1 << 16,
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@cljazouli
Copy link
Copy Markdown
Contributor Author

@sandersn Thanks! I will make those changes

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 4, 2020
@cljazouli cljazouli requested a review from sandersn September 4, 2020 15:53
Copy link
Copy Markdown
Member

@sandersn sandersn left a 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.

@sandersn sandersn self-assigned this Oct 27, 2020
@sandersn sandersn merged commit 3fe05c8 into microsoft:master Feb 17, 2021
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Typo in AllowQualifedNameInPlaceOfIdentifier

4 participants