jsx-no-comment-textnodes
Configuration
rslint.config.ts
Disallow comments from being inserted as text nodes.
This rule prevents comment strings (e.g. beginning with // or /*) from being
accidentally injected as a text node in JSX statements. Comments in JSX must be
wrapped in an expression container ({/* ... */}) to be treated as actual
comments instead of literal text.
Rule Details
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Legitimate uses
It is possible to intentionally output comment-start characters (// or /*)
inside a JSX text node — wrap the content in an expression container so the
text is parsed as a string literal instead of a raw text node: