Skip to content

Commit 47f7391

Browse files
authored
fix(typescript-estree): ensure the token type of the property name is Identifier (typescript-eslint#11329)
1 parent f08d08f commit 47f7391

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

packages/typescript-estree/src/node-utils.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -480,25 +480,6 @@ export function getTokenType(
480480
if (token.kind === SyntaxKind.NullKeyword) {
481481
return AST_TOKEN_TYPES.Null;
482482
}
483-
let keywordKind: ts.SyntaxKind | undefined;
484-
if (isAtLeast50 && token.kind === SyntaxKind.Identifier) {
485-
keywordKind = ts.identifierToKeywordKind(token as ts.Identifier);
486-
} else if ('originalKeywordKind' in token) {
487-
// @ts-expect-error -- intentional fallback for older TS versions <=4.9
488-
keywordKind = token.originalKeywordKind;
489-
}
490-
if (keywordKind) {
491-
if (keywordKind === SyntaxKind.NullKeyword) {
492-
return AST_TOKEN_TYPES.Null;
493-
}
494-
if (
495-
keywordKind >= SyntaxKind.FirstFutureReservedWord &&
496-
keywordKind <= SyntaxKind.LastKeyword
497-
) {
498-
return AST_TOKEN_TYPES.Identifier;
499-
}
500-
return AST_TOKEN_TYPES.Keyword;
501-
}
502483

503484
if (
504485
token.kind >= SyntaxKind.FirstKeyword &&

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy