There is a naked project created by Vue CLI, where ESLint does not swear at 2 spaces used as tabulation (code level indent).

And there is my config:

{ "editor.detectIndentation": false, "editor.tabSize": 4, "[json]": { "editor.tabSize": 4 }, "[javascript]": { "editor.tabSize": 4 }, ... } 

those. I need the tab size to be 4 spaces, but Alt + Shift + F (autoformat) or just setting 4 spaces instead of 2:

enter image description here


Question one : how to tell ESLint what tab size do I need?


Question two : what does ESLint want at the end of the lines?
It seems to be set; but if you put, then swears ...

enter image description here

and in the absence of underlines green

enter image description here


Information on setting up this beast is not found on the network.
At least, in the form of clear that this is exactly what you need))


If ESLint has no settings, then tell me another VS Code plugin for Vue.js

  • Semicolons are superfluous, but about the green stroke, he says that he expects the size of the tobacco in 2 spaces, but you have 4) - E1mir
  • Yeah, but ES6 lets you bet; And you need to retrain from 2 to 4 spaces. How? - Evgeny Gureev
  • Your config, there you see it is written: 'editor.tabSize': 4 , for javascript you change it to 2) - E1mir
  • one
    Yes, thanks, it turned out: "eslint.options": {"rules": {"indent": [2, 4]}} - Evgeny Gureev
  • one
    Ok, then answer the question that I could close the question - Evgeny Gureev

1 answer 1

As for setting indents in ESLint, it can be added here: ESLint indent rule , and in VSCode you just need to write this rule for yourself and add it here in the VSCode settings: enter image description here

In addition to the indentation, you can configure a lot of things, or you can simply disable these rules, about all this you can see here in the settings of the rules in ESLint

  • Yes, thanks, it turned out: "eslint.options": {"rules": {"indent": [2, 4]}} - Evgeny Gureev