LoginSignup
2
1

More than 3 years have passed since last update.

Nuxt.js に後から ESLint と Prettier を入れて困った時の解決策

Last updated at Posted at 2019-12-19

Nuxt の公式ドキュメント通りに ESLint と Prettier を入れたら、ファイルの保存時に lintfix が走った後に formatter が走っているような挙動をした。結局 fix されていない。以下の json ファイルを .vscode/settings.json に書いて解決。

vscode/settings.json

{
  "eslint.validate": [
    {
      "language": "vue",
      "autoFix": true
    },
    {
      "language": "javascript",
      "autoFix": true
    }
  ],
  "eslint.autoFixOnSave": true,
  "editor.formatOnSave": false,
}

個人的なメモでした。

追記

「ESLint/Prettier併用で <img /> が怒られる問題」
https://qiita.com/yoshinbo/items/3436face1a1b02f2542f

それでも解決しなかったら、以下を入れてみると良い。

yarn add -D eslint-config-prettier

yarn add -D eslint-plugin-prettier

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1