Home > Back-end >  Can I add ESlint rule about indent on empty lines?
Can I add ESlint rule about indent on empty lines?

Time:02-28

enter image description here

I'm using 2 spaces for indentation and I want to keep it also no empty lines. Currently ESLint shows warning message Delete '··' (prettier/prettier) if there is an indent.

How can I add a rule disables warning about indent on empty lines?

CodePudding user response:

You could use the plugin indent-empty-lines to enforce indentation on empty lines.

The rule indent-empty-lines enforces an indentation of 2 spaces by default.

If you need to configure this for a different number of spaces, e.g. 4, here is an example of the ESLint configuration:

"rules": {
  "indent-empty-lines/indent-empty-lines": [ "error", 4]
}

More information about the configuration here.

  • Related