-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
area:template 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.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Description
Prettier 1.8.2
Playground link
# Options (if any):
--print-width=80Input:
class Quote {
character = {
name: 'Dorian'
}
text = `Yes, ${this.character.name}, you will always be fond of me. I represent to you all the sins you have never had the courage to commit.`
}Output:
class Quote {
character = {
name: "Dorian"
};
text = `Yes, ${
this.character.name
}, you will always be fond of me. I represent to you all the sins you have never had the courage to commit.`;
}Expected behavior:
I would prefer a long string to not get split into multiple lines, even if it contains expressions. When there are no expressions, Prettier correctly lets a long string go beyond the print-width limit.
I can't decide if this is a bug or a personal preference, but it's been creating weird hard to read code in our codebase. We can clean most of it up by simplifying our expressions, but there's only so short we can go.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:template 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.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken