-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Long string values in object literals sometimes look strange #3711
Copy link
Copy link
Labels
area:object literalslang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 1.10.2
Playground link
--tab-width 4Input:
var obj = {
// an entry with a very long string
x: "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
};Output:
var obj = {
// an entry with a very long string
x:
"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
};Expected behavior:
Leave it as it was. This wrapping doesn't make it any better. Especially when the property name is short and --tab-width is 4.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:object literalslang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.