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

VSCode で Vue.js に自動で ESLint をかける

まえがき

いままで訳も分からず "editor.formatOnSave": true にして整形してたんですが、この度の Vue 開発で .eslintrc を設定していてもそいつをガン無視して謎の整形をかけられてしまいずっと eslint エラーが出続ける、っていう問題が発生したので、対処法をメモ。

settings.json を設定

メニューの Code > 基本設定 > 設定 (または ⌘ + , )から設定を開いて、設定ファイルに以下を追記。

settings.json
"files.associations": {
    "*.vue": "vue"
},
"eslint.validate": [
    "javascript",
    "javascriptreact",
    {
    "language": "vue",
    "autoFix": true
    }
]

で、 "editor.formatOnSave": false"eslint.autoFixOnSave": true をすると、ESLint だけがファイル保存時整形をしてくれるので、これで一安心。

あとがき

結局、VSCode の Editor: Format On Save は誰の指示でどんなルールで整形してるんですかね。。エディタ?

追記 2019-02-02

ここ( https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode )を見る感じ、vscode の setting.json の editor.* 系の設定は prettier のものだったかもしれないです。かもしれない。

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
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