Avoid comments from being inserted as text nodes
このページは日本語には対応しておりません。随時翻訳に取り組んでいます。
翻訳に関してご質問やご意見ございましたら、
お気軽にご連絡ください。
ID: tsx-react/jsx-no-comment-textnodes
Language: TypeScript
Severity: Warning
Category: Error Prone
As JSX mixes HTML and JavaScript together, comments in text nodes must be in brackets to be evaluated as JavaScript instead of HTML. This rule prevents you from accidentally leaving comments as HTML text.
var Hello = createReactClass({
render: function() {
return (
<div>
asd /* empty div */
</div>
);
}
});
var Hello = createReactClass({
render: function() {
return (
<div>
/* empty div */
</div>
);
}
});
<Paragraph>
lorem ipsum
<InlineCode>http://localhost:8126</InlineCode> lorem ipsum
</Paragraph>
var Hello = createReactClass({
displayName: 'Hello',
render: function() {
return <div>{/* empty div */}</div>;
}
});
var Hello = createReactClass({
displayName: 'Hello',
render: function() {
return <div /* empty div */></div>;
}
});
var Hello = createReactClass({
displayName: 'Hello',
render: function() {
return <div className={'foo' /* temp class */}></div>;
}
});