2

I'm working with WebStorm and there is only two possibilities to use ESLint :

  • Apply ESLint to file
  • Apply ESLint to a line

Isn't there a possibility to apply ESLint to a selection of multiple lines ?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Drea Zener
  • 323
  • 1
  • 2
  • 7

1 Answers1

2

There is no way to apply ESLint fix to selection in WebStorm, ESLint itself doesn't support range formatting/fixing. But you can import your code style preferences from .eslintrc and then use the built-in formatter (Code | Reformat Code) to format the selection.

Note also that you can set up Prettier as your default formatter and then use it to format a selection with Code | Reformat Code

lena
  • 90,154
  • 11
  • 145
  • 150