LoginSignup
0
0

More than 3 years have passed since last update.

nuxtプロジェクトで、インストールしたPrettier,eslintの使用方法

Posted at

個人的なメモ

eslintによるコードの整形はデフォルトでは使用できないので、package.jsonのscripts{}の中に一行追加する。

  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .",
    "lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore",
    "lint": "yarn lint:js && yarn lint:style",
    // ここに一行追加
    "lintfix": "eslint --fix --ext .js,.vue --ignore-path .gitignore ."
  },

これで、yarn lintfixで規約に反した全てのコードを整形してくれる。

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