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

Prettier does not respect the "no-multiple-empty-lines" rule of eslint #176

Closed
ghost opened this issue May 7, 2018 · 10 comments
Closed

Comments

@ghost
Copy link

ghost commented May 7, 2018

Prettier removes any multiple empty lines collapsing to max 1 empty line.
I understand the default behavior but I would like to override it with eslint

Example with my rule (google/airbnb style guide):
"no-multiple-empty-lines": ["error", { "max": 2 }]

a = 1


b = 2

Becomes:

a = 1

b = 2

Opinionated behavior should only be the default and should be configurable.
Ref: prettier/prettier#1613

@zimme
Copy link
Member

zimme commented May 7, 2018

This is not possible as the output eslint gets is already ran though prettier. The only way to get the outcome you're after is to add an option about this in prettier.

@zimme zimme closed this as completed May 7, 2018
@manuel-di-iorio
Copy link

Yes I'm looking for an option in Prettier for this, but cannot see any here: https://prettier.io/docs/en/options.html.
I will create an Issue in their repo, thanks

@zimme
Copy link
Member

zimme commented May 8, 2018

I'm thinking that for your case if you really don't want the prettier way of formatting then maybe it's just better for you to go with using eslint only.

@manuel-di-iorio
Copy link

manuel-di-iorio commented May 8, 2018

@zimme I'm evaluating also that, but if I'm not in wrong, Prettier can format better than eslint in some cases, that's why I was using it in the first place.
See: #101

Will think about, thanks 👍

@rjmoggach
Copy link

Prettier rocks... I want two spaces between my functions and classes... please!!!

@zimme
Copy link
Member

zimme commented Sep 22, 2019

We can't do anything about this until prettier changes its formatting or add an option to allow multiple empty lines.

Eslint isn't powerful enough to revert all formatting that prettier imposes.

@Tester798
Copy link

Yeah, sometimes I like to add two empty lines for better code readability, but prettier is leaving only one line there after formatting. Would be nice to have configurable option for this.

@helight59
Copy link

Why do they decide for us what will be more beautiful for our project?

@MWatzlaw
Copy link

MWatzlaw commented Feb 24, 2024

Yes, I make my code much more readable using multiple empty lines! Why ignoring such an important thing, so much user asking for?
Hey, if they hate it, nobody is pushed to do that. But why the user fortbidding to do so?

@JounQin
Copy link
Member

JounQin commented Feb 24, 2024

Complain helps nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants