File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
packages/typescript-estree/src Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -579,24 +579,17 @@ export function getTokenType(token: any): AST_TOKEN_TYPES {
579
579
}
580
580
581
581
// Some JSX tokens have to be determined based on their parent
582
- if ( token . parent ) {
582
+ if ( token . parent && token . kind === SyntaxKind . Identifier ) {
583
+ if ( isJSXToken ( token . parent ) ) {
584
+ return AST_TOKEN_TYPES . JSXIdentifier ;
585
+ }
586
+
583
587
if (
584
- token . kind === SyntaxKind . Identifier &&
585
588
token . parent . kind === SyntaxKind . PropertyAccessExpression &&
586
589
hasJSXAncestor ( token )
587
590
) {
588
591
return AST_TOKEN_TYPES . JSXIdentifier ;
589
592
}
590
-
591
- if ( isJSXToken ( token . parent ) ) {
592
- if ( token . kind === SyntaxKind . PropertyAccessExpression ) {
593
- return AST_TOKEN_TYPES . JSXMemberExpression ;
594
- }
595
-
596
- if ( token . kind === SyntaxKind . Identifier ) {
597
- return AST_TOKEN_TYPES . JSXIdentifier ;
598
- }
599
- }
600
593
}
601
594
602
595
return AST_TOKEN_TYPES . Identifier ;
Original file line number Diff line number Diff line change @@ -174,7 +174,6 @@ export enum AST_TOKEN_TYPES {
174
174
Boolean = 'Boolean' ,
175
175
Identifier = 'Identifier' ,
176
176
JSXIdentifier = 'JSXIdentifier' ,
177
- JSXMemberExpression = 'JSXMemberExpression' ,
178
177
JSXText = 'JSXText' ,
179
178
Keyword = 'Keyword' ,
180
179
Null = 'Null' ,
You can’t perform that action at this time.
0 commit comments