-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Excessive line breaks for a short comparison expression #3621
Copy link
Copy link
Closed
Labels
area:member chainslang: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.9.2
Playground link
Input:
const palindrome = str => {
const s = str.toLowerCase().replace(/[\W_]/g, '');
return s === s.split('').reverse().join('');
};Output:
const palindrome = str => {
const s = str.toLowerCase().replace(/[\W_]/g, "");
return (
s ===
s
.split("")
.reverse()
.join("")
);
};Expected behavior:
The line breaks probably shouldn't occur in this case. It's excessive and doesn't look very nice.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:member chainslang: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