-
Notifications
You must be signed in to change notification settings - Fork 173
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
feat: add jsx-no-unescaped-entities rule #1348
Conversation
} | ||
|
||
const MESSAGE: &str = "Found one or more unescaped entities in JSX text"; | ||
const HINT: &str = "Escape the '\">} characters respectively"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing - is '
character supposed to be escaped? If so it's not listed in the list below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's listed here
.replace('\'', "'") |
assert_lint_err! { | ||
JSXNoUnescapedEntities, | ||
filename: "file:///foo.jsx", | ||
r#"<div>'">}</div>"#: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please exercise all possible characters here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're all listed
b019dab
to
a2a2bea
Compare
This rule ensure that you're not accidentally passing entities like
>
as text when you didn't intend to.