You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to Prettier (for Typescript) and I like pretty much all the decisions it makes except the one that removes the empty line at the beginning of a function.
I wish Prettier would keep such empty line if there's one, the same way it keeps an empty line elsewhere in the function.
For example :
beforeEach(async () => {
// Sets the server port
serverPort = 123;
// The previous empty line is kept
});
would stay as is, and not reformatted to:
beforeEach(async () => {
// Sets the server port
serverPort = 123;
// The previous empty line is kept
});
But if there is no empty line, none would be added :
beforeEach(async () => {
// Sets the server port
serverPort = 123;
// The previous empty line is kept
});
would also stay as is.
Any chance we can have this feature?
The text was updated successfully, but these errors were encountered:
Empty lines have been discussed a lot, and Prettier has settled on its current "at most one blank line in a row, and no blank lines at the start and end of things" rule which seems to reasonable in 99% of the cases. Here is the most similar issue I could find right now: #2352.
I'm closing this one since it does not seem like this will be changed. Sorry! Feel free to comment here if I missed something.
@lydell Could you please kindly point to the file and line where this rule is implemented, I just thought of forking the lib because of this option, but feel quite lost looking at the code
Thanks!
I'm new to Prettier (for Typescript) and I like pretty much all the decisions it makes except the one that removes the empty line at the beginning of a function.
I wish Prettier would keep such empty line if there's one, the same way it keeps an empty line elsewhere in the function.
For example :
would stay as is, and not reformatted to:
But if there is no empty line, none would be added :
would also stay as is.
Any chance we can have this feature?
The text was updated successfully, but these errors were encountered: