Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDisallow accidental comments in JSX from being inserted as text nodes (react/jsx-no-comment-textnodes) #1368
Comments
feross
added
enhancement
accepted
labels
Aug 15, 2019
feross
added this to the standard 14 milestone
Aug 15, 2019
feross
changed the title
Disallow accidental comments from being inserted as text nodes (react/jsx-no-comment-textnodes)
Disallow accidental comments in JSX from being inserted as text nodes (react/jsx-no-comment-textnodes)
Aug 15, 2019
This comment has been minimized.
This comment has been minimized.
|
Shipping in |
feross
closed this
in
29861dc
Aug 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
feross commentedAug 15, 2019
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
This rule prevents comment strings (e.g. beginning with
//or/*) from being accidentallyinjected as a text node in JSX statements.
Rule Details
The following patterns are considered warnings:
The following patterns are not considered warnings:
Legitimate uses
It's possible you may want to legitimately output comment start characters (
//or/*)in a JSX text node. In which case, you can do the following: