Skip to content
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

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

marvinhagemeister
Copy link
Contributor

This rule ensure that you're not accidentally passing entities like > as text when you didn't intend to.

}

const MESSAGE: &str = "Found one or more unescaped entities in JSX text";
const HINT: &str = "Escape the '\">} characters respectively";
Copy link
Member

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

Copy link
Contributor Author

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>"#: [
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're all listed

@marvinhagemeister marvinhagemeister merged commit 6d05e3b into main Dec 10, 2024
7 checks passed
@marvinhagemeister marvinhagemeister deleted the unescaped-entities branch December 10, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants