-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new rule: no-comment-textnodes #616
Conversation
What about false positives where the literal JS comment text is what's desired? |
@ljharb – They have two choices. Either disable the rule, or do: <div>{'// Not a comment'}</div> I personally think that's acceptable. This strikes me as a particularly rare edge case. |
@benvinegar want to add documentation for the rule, and include that info in it explicitly? :-D |
@ljharb – Updated with documentation. |
Seems to be a useful rule. Merged, thanks! |
a bite late, but: shouldn't the name of the rule be prefixed with |
I agree that this rule should have been prefixed with jsx-. |
No reason we couldn't change that as part of the next major bump. |
Our team has run into issues where people mistakenly commit comments as text nodes, and they have managed to get through code review and appeared (embarrassingly) in our UI. I threw together this rule to try and catch such occasions, and thought it might be useful to other users of this ESLint plugin.
Feedback, comments greatly appreciated.