Ver código fonte

调整部分eslint校验规则

cfort 2 anos atrás
pai
commit
2ebd95cfcc
1 arquivos alterados com 14 adições e 27 exclusões
  1. 14 27
      .eslintrc.js

+ 14 - 27
.eslintrc.js

@@ -67,27 +67,18 @@ module.exports = {
             'after': true
         }],
         'handle-callback-err': [2, '^(err|error)$'],
-        // 'indent': ["off", 2, {
-        //     'SwitchCase': 1
+        'indent': [2, 4, {
+            'SwitchCase': 1
+        }],
+        // "vue/script-indent": [2, 4, {
+        //     "baseIndent": 1,
+        //     "switchCase": 1
         // }],
-        "vue/script-indent": [
-            2,
-            4,
-            {
-                "baseIndent": 1,
-                "switchCase": 1,
-                "MemberExpression": 1
-            }
-        ],
-        "vue/html-indent": [
-            2,
-            4,
-            {
-                "attribute": 1,
-                "closeBracket": 0,
-                "alignAttributesVertically": true
-            }
-        ],
+        "vue/html-indent": [2, 4, {
+            "attribute": 1,
+            "closeBracket": 0,
+            "alignAttributesVertically": true
+        }],
         'jsx-quotes': [2, 'prefer-single'],
         'key-spacing': [2, {
             'beforeColon': false,
@@ -174,13 +165,9 @@ module.exports = {
         }],
         'no-unreachable': 2,
         'no-unsafe-finally': 2,
-        // 'no-unused-vars': [2, {
-        //     'vars': 'all',
-        //     'args': 'none'
-        // }],
-        // 当存在定义而未使用的组件时,关闭报错
+        // 鏍¢獙瀛樺湪瀹氫箟鑰屾湭浣跨敤鐨勭粍浠�
         'vue/no-unused-components': 'off',
-        // 当存在定义而未使用的变量时,关闭报错
+        // 鏍¢獙瀛樺湪瀹氫箟鑰屾湭浣跨敤鐨勫彉閲�
         'no-unused-vars': 'off',
         'no-useless-call': 2,
         'no-useless-computed-key': 2,
@@ -208,7 +195,7 @@ module.exports = {
             'after': true
         }],
         'space-before-blocks': [2, 'always'],
-        'space-before-function-paren': [2, 'never'],
+        'space-before-function-paren': [2, 'always'],
         'space-in-parens': [2, 'never'],
         'space-infix-ops': 2,
         'space-unary-ops': [2, {