Skip to content

Instantly share code, notes, and snippets.

@itoz
Created January 31, 2020 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itoz/0fc7ef712251c1e149264676b2363b6f to your computer and use it in GitHub Desktop.
Save itoz/0fc7ef712251c1e149264676b2363b6f to your computer and use it in GitHub Desktop.
eslintrc.js for nuxt
module.exports = {
plugins: [
"vue"
],
extends: [
'@nuxtjs',
'plugin:nuxt/recommended',
'plugin:vue/recommended',
],
rules: {
// タグの最後で改行しない
"vue/html-closing-bracket-newline": [2, {"multiline": "never"}],
// 不要なカッコ消す
"no-extra-parens": 2,
// 無駄なスペース削除
"no-multi-spaces": 2,
// 不要な空白行削除。2行開たらエラー
"no-multiple-empty-lines": [2, {"max": 1}],
// 関数とカッコはあけない
"func-call-spacing": [2, "never"],
// true/falseを無駄に使わない
"no-unneeded-ternary": 2,
// セミコロン禁止
"semi": [2, "never"],
// 文字列はシングルクオートのみ
"quotes": [2, "single"],
// var禁止
"no-var": 2,
// jsのインデントは2
"indent": [2, 2],
// かっこの中はスペースなし
"space-in-parens": [2, "never"],
// カンマの前後にスペース入れる
"comma-spacing": 2,
// 配列のindexには空白入れるな(hogehoge[ x ])
"computed-property-spacing": 2,
// キー
"key-spacing": 2,
// キーワードの前後には適切なスペース
"keyword-spacing": 2,
// productionではconsole 記述はエラー
"no-console": process.env.NODE_ENV === 'production' ? 2 : 1,
// 利用されていない変数
"no-unused-vars":1,
// 利用されていないコンポネント
"vue/no-unused-components":1,
// ホワイトスペースを注意
"no-irregular-whitespace":1,
// v-for に keyが設定されていない場合
"vue/require-v-for-key":2,
// 1行が長すぎる場合に折り返ししない
"vue/max-attributes-per-line": "off",
//async内にawaitがないとだめ
"require-await":1,
//異なる演算子の混合
"no-mixed-operators":2,
//return に代入式を利用しない
"no-return-assign":1,
//厳密等価演算子を利用
"eqeqeq":1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment