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

Avoid unnecessary escape sequences inside string literals #1511

Open
gflohr opened this issue Mar 27, 2024 · 0 comments
Open

Avoid unnecessary escape sequences inside string literals #1511

gflohr opened this issue Mar 27, 2024 · 0 comments

Comments

@gflohr
Copy link

gflohr commented Mar 27, 2024

Feature request.

Input:

const foo = 'bar\tbaz';

Output:

const foo='bar\tbaz';

Expected:

const foo='bar baz';

Well, the expected output outsmarts the GitHub editor. The space should really be a tab character.

Rationale: The escape sequence \t is two bytes long, the literal tab just one, and there is never a need to escape it withing string literals.

The same goes for \v, '\r', '\f', '\b', although theses characters are, of course, much less common.

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

No branches or pull requests

1 participant