Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why isn't it possible to keep prettier from adding empty line to my files?! #8559

Closed
SassNinja opened this issue Jun 14, 2020 · 4 comments
Closed
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:option request Issues requesting a new option. We generally don’t accept these unless there is technical necessity.

Comments

@SassNinja
Copy link

Prettier 2.0.5
Playground link

Input:

const problem = "I don't wana see an empty line at the end of my file!";

Output:

const problem = "I don't wana see an empty line at the end of my file!";\n

Expected behavior:

I expect prettier considers my .editorconfig file or at least provides an option to turn this behavior off.

I've already found an old issue about this problem:
#6360

However I can't understand why prettier is such arrogant, assuming its rules are the only valid ones.
I mean I can accept there are some requirements for a consistent logic and the easy-to-use philosophy.

But I can't except a tool prohibits me to decide whether I wanna have an empty line at the end of each file or not. And I can't believe it's that much work to add some more options so people who are not happy with the default behavior may change it.

I've noticed there are some discussions about making prettier more extensible (via plugin system etc.) which I like
#8507 (comment)
though that's much more that I expect.

I only want the existing prettier rules to be toggleable so I don't get an empty line in each file that's formatted by prettier.

May anyone (from the core team) tell me if that's gonna happen in near future?
Otherwise I'm forced to completely throw away prettier because it's more than annoying.

@j-f1 j-f1 added the type:option request Issues requesting a new option. We generally don’t accept these unless there is technical necessity. label Jun 14, 2020
@j-f1
Copy link
Member

j-f1 commented Jun 14, 2020

As specified in our option philosophy, we don’t want to add more options: https://prettier.io/docs/en/option-philosophy.html

However I can't understand why prettier is such arrogant, assuming its rules are the only valid ones.

I don’t think that’s our stance. It’s more that the rules Prettier follows result in readable code in most cases, and the benefits obtained by not having to think about code formatting at all outweigh the (temporary) readability costs of not following your particular preference.

@j-f1 j-f1 closed this as completed Jun 14, 2020
@SassNinja
Copy link
Author

SassNinja commented Jun 14, 2020

@j-f1 thanks for the clear words!

Unfortunately this means we're not going to use prettier any longer in my company at least not this restricted version.

the benefits obtained by not having to think about code formatting at all

or rather the benefits of getting infantilized...
(I've realized it doesn't make sense to discus this any further)

@netlander
Copy link

At least the utility should allow for this behaviour to be disabled even if 99% of devs want an extra line at the end of the file, there might be some good reasons for wanting to disable this default behaviour.

@alexander-akait
Copy link
Member

alexander-akait commented Jun 15, 2020

https://prettier.io/docs/en/option-philosophy.html

We don't want to support option(s). No problems with one empty line at the end of file

@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Sep 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:option request Issues requesting a new option. We generally don’t accept these unless there is technical necessity.
Projects
None yet
Development

No branches or pull requests

4 participants