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

Template strings aren't moved to new line, where '' or "" strings are #4719

Open
coolreader18 opened this issue Jun 20, 2018 · 2 comments · May be fixed by #7204
Open

Template strings aren't moved to new line, where '' or "" strings are #4719

coolreader18 opened this issue Jun 20, 2018 · 2 comments · May be fixed by #7204
Assignees
Labels
area:template literals lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program

Comments

@coolreader18
Copy link

Prettier 1.13.5
Playground link

Input:

const a =
  `verylongstringverylongstringverylongstringverylongstringverylongstring`

const b = "verylongstringverylongstringverylongstringverylongstringverylongstring"

Output:

const a = `verylongstringverylongstringverylongstringverylongstringverylongstring`;

const b =
  "verylongstringverylongstringverylongstringverylongstringverylongstring";

Expected behavior: The template string is moved to the next line after the const a =.

I'd assume that this happens because it assumes about indentation, as that is part of the
string in multiline template strings.

@j-f1 j-f1 added lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program labels Jun 20, 2018
@Marcholio
Copy link

Any updates on this? Confirmed that it's still valid in v1.16.3.

@alexander-akait
Copy link
Member

@Marcholio PR welcome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:template literals lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
6 participants