Visual Studio Code - How to format selection with eslint

Viewed 603

I found out that if I write in my settings.json that:

  "eslint.format.enable": true,
  "[javascriptreact]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint",
  }

Then I can format the whole page using ALT + SHIFT + F with ESLint ( or right click -> Format Document ).

I can also see once I right click -> Format Selection With.... then I can see ESLint as an option.

But if I select a line and press right click, then Format Selection With... I can't find the Eslint option. ( or as a shortcut CTRL+K )

So how can I format selection with ESLint?

0 Answers
Related