-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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 export default expression comment #48323
Conversation
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
@@ -1140,6 +1140,9 @@ namespace ts { | |||
const varDecl = factory.createVariableDeclaration(newId, /*exclamationToken*/ undefined, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); | |||
errorFallbackNode = undefined; | |||
const statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(SyntaxKind.DeclareKeyword)] : [], factory.createVariableDeclarationList([varDecl], NodeFlags.Const)); | |||
|
|||
preserveJsDoc(statement, input); | |||
removeAllComments(input); |
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.
this is probably a question for @rbuckton , but why do you need to removeAllComments(input)
? The other uses of preserveJSDoc don't do that.
I have a question about why removeAllComments is needed. |
The |
If I add /**
* JSDoc Comments
*/
declare const _default: any;
export default _default; If I remove /**
* JSDoc Comments
*/
declare const _default: any;
/**
* JSDoc Comments
*/
export default _default; |
Fixes #48305