-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Leave one-line functions alone #4125
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.
Description
Prettier 1.10.2
Playground link
--arrow-parens alwaysInput:
const sha256 = (data) => crypto.createHash("sha256").update(data).digest("hex");Output:
const sha256 = (data) =>
crypto
.createHash("sha256")
.update(data)
.digest("hex");Expected behavior:
The input was perfectly fine as it stood; it was a nice one-liner, exactly 80 characters long. Breaking it into multiple lines just makes it less clear. Is there a specific reason prettier behaves this way?
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.