@sergey19940808

Vue cli, как правильно настроить eslint?

Создал проект с помощью vue cli: vue init webpack vue-example
Как конфигурировать eslint. В файле .editorconfig изменил содержимое на:
root = true

[*]
charset = utf-8
indent_style = tab
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

Но получаю ошибки:
Expected indentation of 2 spaces but found 4 spaces
  src/App.vue:2:1
      <div id="app">
   ^

  ✘  https://google.com/#q=vue%2Fhtml-self-closing  Require self-closing on HTML elements (<div>)
  src/App.vue:2:5
      <div id="app">
       ^

  ✘  https://google.com/#q=vue%2Fhtml-indent        Expected indentation of 2 spaces but found 4 spaces
  src/App.vue:3:1
      </div>
   ^

  ✘  http://eslint.org/docs/rules/indent            Expected indentation of 1 tab but found 4 spaces
  • Вопрос задан
  • 2814 просмотров
Пригласить эксперта
Ответы на вопрос 1
aloky
@aloky
js
может надо тут менять .eslintrc?

Пример:
{
    "parser": "babel-eslint",
    "extends": "airbnb",
    "plugins": [
        "react",
        "jsx-a11y",
        "import"
    ],
    "rules":{
        "indent": [2, "tab"],
        "no-tabs": 0
    }
}
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы