Help us understand the problem. What is going on with this article?

vue vscode eslint 勝手に補完

More than 1 year has passed since last update.

vue-cliで作成したプロジェクトをVSCodeで編集するときの設定

無限ループ発生

  • vueファイルを上書き保存
  • 行末に;が保管される
  • その;をeslintがエラーです。と怒る
  • その;を自分で消す

これを繰り返していました。
とりあえずこれに気付くのに、30分くらいかかった

直し方

結果的には、
.vscode/settings.jsonを編集したら治りました。

{

}
の中に、下記のように追加してください。
たぶん、人によっては既になにかしら書かれているかと思いますが、追記してください。上書いたら、何かしらの設定が消えると思いますので、追記でお願いします。
それでも治らなかったら、
https://github.com/vuejs/vetur/issues/476
https://qiita.com/skta/items/dbab3f669372f8623cd4
を参照してください。

追記してね。
{
"vetur.format.defaultFormatter.js": "vscode-typescript",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
}

以下、実際のエラー内容です

エラー内容全文
 WAIT  Compiling...                                                            17:12:09
 95% emitting

 WARNING  Compiled with 1 warnings                                             17:12:10

  ✘  http://eslint.org/docs/rules/quotes                       Strings must use singlequote
  src\components\HelloWorld.vue:11:19
  import axios from "axios";
                     ^

  ✘  http://eslint.org/docs/rules/semi                         Extra semicolon

  src\components\HelloWorld.vue:11:26
  import axios from "axios";
                            ^

  ✘  http://eslint.org/docs/rules/quotes                       Strings must use singlequote
  src\components\HelloWorld.vue:13:9
    name: "helloWorld",
           ^

  ✘  http://eslint.org/docs/rules/space-before-function-paren  Missing space before function parentheses
  src\components\HelloWorld.vue:14:7
    data() {
         ^

  ✘  http://eslint.org/docs/rules/quotes                       Strings must use singlequote
  src\components\HelloWorld.vue:16:12
        msg: "Welcome to Your Vue.js App"
              ^

  ✘  http://eslint.org/docs/rules/semi                         Extra semicolon

  src\components\HelloWorld.vue:17:6
      };
        ^

  ✘  http://eslint.org/docs/rules/space-before-function-paren  Missing space before function parentheses
  src\components\HelloWorld.vue:20:30
      apiPublic: async function() {
                                ^

  ✘  http://eslint.org/docs/rules/quotes                       Strings must use singlequote
  src\components\HelloWorld.vue:21:33
        let res = await axios.get("http://localhost:8080/public");
                                   ^

  ✘  http://eslint.org/docs/rules/semi                         Extra semicolon

  src\components\HelloWorld.vue:21:64
        let res = await axios.get("http://localhost:8080/public");
                                                                  ^

  ✘  http://eslint.org/docs/rules/semi                         Extra semicolon

  src\components\HelloWorld.vue:22:26
        this.msg = res.data;
                            ^

  ✘  http://eslint.org/docs/rules/space-before-function-paren  Missing space before function parentheses
  src\components\HelloWorld.vue:24:31
      apiPrivate: async function() {
                                 ^

  ✘  http://eslint.org/docs/rules/quotes                       Strings must use singlequote
  src\components\HelloWorld.vue:25:33
        let res = await axios.get("http://localhost:8080/private");
                                   ^

  ✘  http://eslint.org/docs/rules/semi                         Extra semicolon

  src\components\HelloWorld.vue:25:65
        let res = await axios.get("http://localhost:8080/private");
                                                                   ^

  ✘  http://eslint.org/docs/rules/semi                         Extra semicolon

  src\components\HelloWorld.vue:26:26
        this.msg = res.data;
                            ^

  ✘  http://eslint.org/docs/rules/semi                         Extra semicolon

  src\components\HelloWorld.vue:29:2
  };
    ^


✘ 15 problems (15 errors, 0 warnings)


Errors:
  7  http://eslint.org/docs/rules/semi
  5  http://eslint.org/docs/rules/quotes
  3  http://eslint.org/docs/rules/space-before-function-paren

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

Vue.js + Go言語 + Firebaseでなんか作れるっていうのをやりたかっただけなんだ!
https://qiita.com/po3rin/items/d3e016d01162e9d9de80

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした