module.exports={root:true,//当前配置不允许向上查找parserOptions:{parser:'babel-eslint',//babel-eslint解析器是babel解析器的包装器兼容ESLintParsesourceType:'module'},env:{browser:true,//浏览器全局变量node:true,//nodejs变量和语法es6:true,//启用ES6语法},//指定browserenvironmentextends:['plugin:vue/recommended','eslint:recommended'],//在此处添加自定义规则//它基于https://github.com/vuejs/eslint-config-vue规则:{"vue/max-attributes-per-line":[2,{"singleline":10,"multiline":{"max":1,"allowFirstLine":false}}],//是否属性个数模板每行不超过定义的最大值,超过则断行"vue/singleline-html-element-content-newline":"off",//强制在内容前后加换行单行元素"vue/multiline-html-element-content-newline":"off",//多行元素内容前后需要换行符"vue/name-property-casing":["error","PascalCase"|"kebab-case"],//强控制vue的name属性命名格式"vue/no-v-html":"off",//是否不允许使用v-html'accessor-pairs':2,//强制getter和setter成对出现intheobject'arrow-spacing':[2,{'before':true,'after':true}],//强制箭头函数在箭头前后使用一致的空格'block-spacing':[2,'always'],//禁止或强制在代码块中打开括号之前和关闭括号之后的空格'brace-style':[2,'1tbs',{'allowSingleLine':true}],//强制使用一致的代码块大括号样式'camelcase':[0,{'properties':'always'}],//强制驼峰命名约定'comma-dangle':[2,'never'],//要求或不允许尾随逗号'comma-spacing':[2,{'before':false,'after':true}],//强制逗号前后空格一致'comma-style':[2,'last'],//强制a一致的逗号风格'constructor-super':2,//requiresuper()callsinconstructors'curly':[2,'multi-line'],//强制所有控制lstatementstobeconsistentbracketstyle'dot-location':[2,'property'],//enforceconsistentnewlinesbeforeandafterthedot'eol-last':2,//requireordisallowablanklineattheend文件'eqeqeq':["error","always",{"null":"ignore"}],//需要===和!=='generator-star-spacing':[2,{'before':true,'after':true}],//在生成器函数中*号前后使用一致的空格'handle-callback-err':[2,'^(err|error)$'],//回调函数中要求容错处理'indent':[2,2,{'SwitchCase':1}],//强制缩进一致'jsx-quotes':[2,'prefer-single'],//强制在JSX属性中使用双引号或单引号'key-spacing':[2,{'beforeColon':false,'afterColon':true}],//强制在对象字面量之间使用一致的间距keysandvaluesinproperties'keyword-spacing':[2,{'before':true,'after':true}],//强制关键字前后使用一致的空格'new-cap':[2,{'newIsCap':true,'capIsNew':false}],//要求构造函数首字母大写'new-parens':2,//强制或禁止调用无参时使用圆圈constructorBrackets'no-array-constructor':2,//禁用数组构造函数'no-caller':2,//禁用arguments.callerorarguments.callee'no-console':'off',//禁用控制台'no-class-assign':2,//禁止修改类声明的变量'no-cond-assign':2,//禁止条件表达式中的赋值运算符'no-const-assign':2,//禁止修改const声明的变量'no-control-regex':0,//禁止使用控制符'no-delete-var'intheregularexpression:2,//禁止删除变量'no-dupe-args':2,//禁止函数定义中重名参数'no-dupe-class-members':2,//禁止类成员中重名'no-dupe-keys':2,//禁止重复键出现inobjectliterals'no-duplicate-case':2,//不允许重复的大小写标签'no-empty-character-class':2,//不要在正则表达式中使用空字符集'no-empty-pattern':2,//禁止使用空解构模式'no-eval':2,//禁用eval()'no-ex-assign':2,//禁止对catch子句的参数重新赋值'no-extend-native':2,//禁止扩展native类型'no-extra-bind':2,//禁止不必要的.bind()调用'no-extra-boolean-cast':2,//禁止不必要的Booleanconversion'no-extra-parens':[2,'functions'],//禁止不必要的括号'no-fallthrough':2,//禁止case语句落入'no-floating-decimal':2,//禁止在数字文字中使用前导和尾随小数点'no-func-assign':2,//Prohibit函数声明的重新赋值'no-implied-eval':2,//禁止使用类似于eval()的方法'no-inner-declarations':[2,'functions'],//禁止变量声明或函数declarationsinnestedblocks'no-invalid-regexp':2,//禁止无效正则表达式字符串'no-irregular-whitespace'inRegExpconstructor:2,//抑制不规则空白'no-iterator':2,//禁用__iterator__attribute'no-label-var':2,//不允许标签与变量同名'no-labels':[2,{'allowLoop':false,'allowSwitch':false}],//禁用标签语句'no-lone-blocks':2,//禁用不必要的嵌套块'no-mixed-spaces-and-tabs':2,//禁止空格和制表符混合缩进'no-multi-spaces':2,//禁止使用多个空格'no-multi-str':2,//禁止使用多行字符String'no-multiple-empty-lines':[2,{'max':1}],//禁止多个空行'no-new-object':2,//DisableObject'sconstructor'no-new-require':2,//调用require时禁止使用new运算符'no-new-symbol':2,//禁止Symbolnew运算符与new一起使用'no-new-wrappers':2,//禁止theuseofthenewoperator'no-obj-calls'forString,NumberandBoolean:2,//禁止将全局对象作为函数调用'no-octal':2,//禁用八进制文字'no-octal-escape':2,//禁用字符串中的八进制转义序列'no-path-concat':2,//禁用__dirname和__filename的字符串连接'no-proto':2,//禁用__proto__属性'no-redeclare':2,//禁止同一个变量的多次声明'no-regex-spaces':2,//禁止在正则表达式字面量中使用多个空格'no-return-assign':[2,'except-parens'],//禁止在返回语句中使用赋值语句'no-self-assign':2,//禁止自赋值'no-self-compare':2,//禁止自我比较'无序nces':2,//禁用逗号运算符'no-shadow-restricted-names':2,//禁用将标识符定义为受限名称'no-sparse-arrays':2,//禁用稀疏数组'no-this-before-super':2,//禁止在构造函数中调用super()之前使用this或super'no-throw-literal':2,//禁止抛出异常字面值'no-trailing-spaces':2,//禁用尾随空格'no-undef':2,//禁用未声明的变量,除非它们在/*global*/comments中被提及'no-undef-init':2,//禁用初始化变量toundefined'no-unexpected-multiline':2,//禁用混淆的多行表达式'no-unmodified-loop-condition':2,//禁用不可变循环条件'no-unneeded-ternary':[2,{'defaultAssignment':false}],//当有更简单的替代表达式时,禁止使用三元运算符'no-unreachable':2,//禁止在return、throw、continue和break语句后使用不可访问的代码'no-unsafe-finally':2,//禁止控制olflowstatements'no-unused-vars'infinallyblock:[2,{'vars':'all','args':'none'}],//禁止未使用的变量'no-useless-call':2,//禁止不必要的.call()和.apply()'no-useless-computed-key':2,//禁用不必要的计算属性'no-useless-constructor':2,//禁用不必要的构造函数'no-useless-escape':0,//Disabledoes不必要使用的转义字符'no-whitespace-before-property':2,//禁用属性前的空格------'no-with':2,//禁用with语句'one-var':[2,{'initialized':'never'}],//强制函数中的变量要么一起声明,要么单独声明'operator-linebreak':[2,'after',{'overrides':{'?':'before',':':'before'}}],//强制操作符使用一致的换行符'padded-blocks':[2,'never'],//要求或禁止块填充'quotes':[2,'single',{'avoidEscape':true,'allowTemplateLiterals':true}],//强制使用一致的反引号、双引号或单引号'semi':[2,'never'],//要求或禁止使用分号代替ASI'semi-spacing':[2,{'before':false,'after':true}],//强制分号前后的空格一致'space-before-blocks':[2,'always'],//强制在块之前使用一致的空格'space-before-function-paren':[2,'never'],//强制在块之前使用一致的空格函数'space-in-parens'的左括号:[2,'never'],//在括号内强制使用一致的空格'space-infix-ops':2,//运算符周围需要空格'space-unary-ops':[2,{'words':true,'nonwords':false}],//强制一元运算符前后的空格一致'spaced-comment':[2,'always',{'markers':['global','globals','eslint','eslint-disable','*package','!',',']}],//注释中必填//或/*使用一致的间距'template-curly-spacing':[2,'never'],//要求或不允许在模板字符串中嵌入表达式周围使用空格'use-isnan':2,//RequireisNaN()检查NaN'valid-typeof':2,//强制将typeof表达式与有效字符串进行比较'wrap-iife':[2,'any'],//要求IIFE括在括号中Up'yield-star-spacing':[2,'both'],//在yield*表达式中强制*周围有空格'yoda':[2,'never'],//要求或禁止“Yoda”条件'prefer-const':2,//要求使用const来声明声明'no-debugger'后不再修改的变量:process.env.NODE_ENV==='production'?2:0,//禁用调试器'object-curly-spacing':[2,'always',{objectsInObjects:false}],//强制花括号之间的间距一致'array-bracket-spacing':[2,'never']//在数组括号中强制使用一致的空格}}
