0
votes

In this example

if (true) {
  doFirstThing();
  doSecondThing();
} else {
  doSomethingElse();
}

I want to add new line before each else and else if block.

if (true) {
  doFirstThing();
  doSecondThing();

} else {
  doSomethingElse();
}

Is there any ESlint rule that can do that?

2

2 Answers

0
votes

Their is nothing listed on awesome/eslint, so you would need to write your own plugin. Since Prettier came out no one is writing formatting plugins for eslint anymore, so you may as well just give in and use that, even if it is not 100% to your liking

0
votes

If you are already using ESlint you are accepting rules and code standards provided by it. Plugin can solve the problem but is it really needed?