Skip to content

Long string values in object literals sometimes look strange #3711

@thorn0

Description

@thorn0

Prettier 1.10.2
Playground link

--tab-width 4

Input:

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions