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

string-content: fix jsx autofix for newlines, etc. #2222

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

abrahamguo
Copy link
Contributor

When applying string-content's autofix in a non-curly-braced JSX literal (i.e. a Literal that is a direct child of a JSXAttribute), special characters are wrongly replaced with escape sequences — for example, literal newlines are replaced with \ns.

We can fix this by not applying the escapeString function in this case. This is safe to do because these types of literals cannot contain any escape sequences.

@sindresorhus sindresorhus merged commit b95e75e into sindresorhus:main Nov 27, 2023
19 of 20 checks passed
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.

None yet

3 participants