Text between JSX tags starts with // or /* and is rendered instead of being a comment

tx0/ts:comment-in-jsx-textrecommendedwarningbug

What it finds

<div>// TODO: remove</div>: between JSX tags, // and /* */ are not comments but text, and are rendered on the page. A comment in JSX is written {/* ... */}.

Reported are pieces of JSX text that consist of one // line or of one /* ... */ block. Longer text that only contains such a line, as code samples in prose do, is left alone. Files with syntax errors and files marked @flow, whose type syntax can read as JSX, are skipped.

From the rule's source, comment_in_jsx_text.rs.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:comment-in-jsx-text" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/ts:comment-in-jsx-text] reason="..."

tx0 explain tx0/ts:comment-in-jsx-text shows the same in the terminal. Found a false positive? Report it.