-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
const triviaScanner = ts.createScanner( | ||
ast.languageVersion, | ||
false, | ||
ast.languageVariant, |
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.
we have to provide language variant, 0/1
container.parent && | ||
container.parent.kind === ts.SyntaxKind.JsxOpeningElement && | ||
container.parent.parent && | ||
container.parent.parent.kind === ts.SyntaxKind.JsxElement |
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.
i had to do this instead of checking if type is equal JsxSelfClosingElement
due to:
https://github.com/JamesHenry/typescript-estree/blob/master/src/convert.ts#L2091
i'm going to change logic there latter, to not mutate TS tree
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.
Excellent, thanks!
loc: true, | ||
range: true, | ||
tokens: true, | ||
comment: true, | ||
jsx: true | ||
jsx: path.extname(filename) === '.js' |
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.
Are we missing anything important when we only enable jsx on .js
files and not the .ts
files? How come this change was necessary for this fix?
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.
there was no test cases for ts files in comments
TypeAssertion has same syntax as JSX <FOO>
can be jsx or TypeAssertion, this change make sure that ts files are parsed without jsx flag set to true
The most recent breaking change affects this PR, so the build failed just FYI |
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.
Just need to take the latest breaking change from master into account
🎉 This PR is included in version 10.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@vjeux @Kovensky @j-f1
This PR fixes issue with
//
inside jsxfixes: #6