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
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.
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 馃憤