module.exports= {
root:true,// 停止在父級(jí)目錄中尋找
env: {
es6:true,// 啟用 ES6 語法支持以及新的 ES6 全局變量或類型
node:true// Node.js 全局變量和 Node.js 作用域
? },
extends: ['plugin:vue/essential','@vue/standard'],
rules: {
'no-alert':0,// 禁止使用alert confirm prompt
'no-console':0,// 禁止使用console
'no-debugger':0,// 禁止使用debugger
'prefer-const':0,// 建議使用 const 關(guān)閉
'no-dupe-keys':2,// 在創(chuàng)建對(duì)象字面量時(shí)不允許鍵重復(fù) {a:1,a:1}
'no-dupe-args':2,// 函數(shù)參數(shù)不能重復(fù)
'no-duplicate-imports': [
1,
? ? ? {
includeExports:true
? ? ? }
],// 不允許重復(fù)導(dǎo)入
'no-duplicate-case':2,// switch中的case標(biāo)簽不能重復(fù)
'padded-blocks':0,// 塊語句內(nèi)行首行尾是否要空行
'space-after-keywords': [0,'always'],// 關(guān)鍵字后面是否要空一格
'space-before-blocks': [0,'always'],// 不以新行開始的塊{前面要不要有空格
'space-before-function-paren': [0,'always'],// 函數(shù)定義時(shí)括號(hào)前面要不要有空格
'space-in-parens': [0,'never'],// 小括號(hào)里面要不要有空格
'space-infix-ops':0,// 中綴操作符周圍要不要有空格
eqeqeq:0,// 必須使用全等
'no-var':0,// 禁用var保檐,用let和const代替
'no-inline-comments':0,// 禁止行內(nèi)備注
indent:0,
'vue/script-indent':0,
'vue/require-prop-type-constructor':0,
'vue/no-use-v-if-with-v-for':0,
'no-trailing-spaces':0,// 一行結(jié)束后面不要有空格
'no-multiple-empty-lines':0,// [1, {"max": 2}],空行最多不能超過2行
'no-extra-boolean-cast':0,// 禁止不必要的bool轉(zhuǎn)換
'valid-jsdoc':0,
'one-var':0,// 連續(xù)聲明
semi:0,// 語句強(qiáng)制分號(hào)結(jié)尾
'semi-spacing': [0, {before:false,after:true}],// 分號(hào)前后空格
'no-new':0,// 禁止在使用new構(gòu)造一個(gè)實(shí)例后不賦值
'no-extra-semi':0,// 禁止多余的冒號(hào)
'keyword-spacing':0,
'arrow-parens':0,// 箭頭函數(shù)用小括號(hào)括起來 - 關(guān)閉
'generator-star-spacing':0,// 生成器函數(shù)*的前后空格
'no-mixed-operators':0,
'eol-last':0,// 文件以單一的換行符結(jié)束 - 關(guān)閉
'object-curly-spacing':0,// 大括號(hào)內(nèi)是否允許不必要的空格
'no-callback-literal':0,
'multiline-ternary':0
? },
parserOptions: {
parser:'babel-eslint'
? },
overrides: [
? ? {
files: ['**/__tests__/*.{j,t}s?(x)','**/tests/unit/**/*.spec.{j,t}s?(x)'],
env: {
jest:true
? ? ? }
? ? }
? ]
};