Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat: create TSTypeQuery node when TSImportType has isTypeOf#3076
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
9e7abf9
059d912
8ddcc9a
8794fd3
fcf3f9d
0e6bced
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
type A = typeof import('A'); | ||
type B = import('B').X<Y>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2730,19 +2730,32 @@ export class Converter { | ||
return result; | ||
} | ||
case SyntaxKind.ImportType: { | ||
const range = getRange(node, this.ast); | ||
if (node.isTypeOf) { | ||
const token = findNextToken(node.getFirstToken()!, node, this.ast)!; | ||
range[0] = token.getStart(this.ast); | ||
} | ||
const result = this.createNode<TSESTree.TSImportType>(node, { | ||
type: AST_NODE_TYPES.TSImportType, | ||
argument: this.convertChild(node.argument), | ||
Comment on lines -2737 to +2741 CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. i renamed this property from parameter to argument as is more aligned with typescript/babel and rest of types eg, call expression has | ||
qualifier: this.convertChild(node.qualifier), | ||
typeParameters: node.typeArguments | ||
? this.convertTypeArgumentsToTypeParameters( | ||
node.typeArguments, | ||
node, | ||
) | ||
: null, | ||
range: range, | ||
}); | ||
if (node.isTypeOf) { | ||
return this.createNode<TSESTree.TSTypeQuery>(node, { | ||
type: AST_NODE_TYPES.TSTypeQuery, | ||
exprName: result, | ||
}); | ||
} | ||
return result; | ||
} | ||
case SyntaxKind.EnumDeclaration: { | ||
const result = this.createNode<TSESTree.TSEnumDeclaration>(node, { | ||
Uh oh!
There was an error while loading.Please reload this page.