Skip to content

Commit

Permalink
fix(typescript-estree): jsx comment parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmarks committed Jul 13, 2019
1 parent c2ad091 commit 2728d92
Show file tree
Hide file tree
Showing 4 changed files with 806 additions and 1 deletion.
@@ -0,0 +1,11 @@
const pure = () => {
return (
<Foo
// one
foo={123}
// two
bar="woof"
/>
);
}

4 changes: 3 additions & 1 deletion packages/typescript-estree/src/convert-comments.ts
Expand Up @@ -147,7 +147,9 @@ export function convertComments(
// Rescan after a JSX expression
if (
container.parent &&
container.parent.kind === ts.SyntaxKind.JsxExpression
container.parent.kind === ts.SyntaxKind.JsxExpression &&
container.parent.parent &&
container.parent.parent.kind === ts.SyntaxKind.JsxElement
) {
kind = triviaScanner.reScanJsxToken();
continue;
Expand Down

0 comments on commit 2728d92

Please sign in to comment.