question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:23
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

57reactions
zimmecommented, 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.

22reactions
helight59commented, Nov 29, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prettier doesn't format based on my eslint config - Stack Overflow
I already have an .eslintrc.js and my default formatter (Eslint-prettier) doesn't format according to my eslint rules. For example: when i type ...
Read more >
Integrating with Linters - Prettier
Linters usually contain not only code quality rules, but also stylistic rules. Most stylistic rules are unnecessary when using Prettier, but worse –...
Read more >
How to make ESLint work with Prettier avoiding conflicts and ...
At this point, you have both Prettier and ESLint up and running on your code. Even if it's working, it could be that...
Read more >
Setting up efficient workflows with ESLint, Prettier and ...
In this article I would like to start very easily and go into more depth from topic to topic. In the first step...
Read more >
How to use Prettier with ESLint - Robin Wieruch
How to combine Prettier and ESLint for VSCode, Sublime, or any other IDE/editor. You will get to know the ESLint Prettier Rules that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found