parent
ccda4c7115
commit
09f147decd
|
@ -369,6 +369,13 @@ function addCommentHelper(node, comment) {
|
|||
const comments = node.comments || (node.comments = []);
|
||||
comments.push(comment);
|
||||
comment.printed = false;
|
||||
|
||||
// For some reason, TypeScript parses `// x` inside of JSXText as a comment
|
||||
// We already "print" it via the raw text, we don't need to re-print it as a
|
||||
// comment
|
||||
if (node.type === "JSXText") {
|
||||
comment.printed = true;
|
||||
}
|
||||
}
|
||||
|
||||
function addLeadingComment(node, comment) {
|
||||
|
|
|
@ -21,6 +21,29 @@ abstract class AbstractRule {
|
|||
|
||||
`;
|
||||
|
||||
exports[`jsx.ts 1`] = `
|
||||
var example1 = <div>
|
||||
https://test
|
||||
</div>;
|
||||
|
||||
var example2 = <div>
|
||||
/*test*/
|
||||
</div>;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
var example1 = (
|
||||
<div>
|
||||
https://test
|
||||
</div>
|
||||
);
|
||||
|
||||
var example2 = (
|
||||
<div>
|
||||
/*test*/
|
||||
</div>
|
||||
);
|
||||
|
||||
`;
|
||||
|
||||
exports[`types.ts 1`] = `
|
||||
(() => {
|
||||
// swallow error and fallback to using directory as path
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
var example1 = <div>
|
||||
https://test
|
||||
</div>;
|
||||
|
||||
var example2 = <div>
|
||||
/*test*/
|
||||
</div>;
|
Loading…
Reference in New Issue