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

Created on 7 May 2018  路  6Comments  路  Source: prettier/prettier-eslint

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: https://github.com/prettier/prettier/issues/1613

Most helpful comment

@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: https://github.com/prettier/prettier-eslint/issues/101

Will think about, thanks 馃憤

All 6 comments

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.

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

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.

@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: https://github.com/prettier/prettier-eslint/issues/101

Will think about, thanks 馃憤

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryanpcmcquen picture ryanpcmcquen  路  7Comments

Vadorequest picture Vadorequest  路  7Comments

briandipalma picture briandipalma  路  6Comments

chrisdrackett picture chrisdrackett  路  10Comments

chrisbobbe picture chrisbobbe  路  8Comments