-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy path.eslintrc.js
129 lines (123 loc) · 3.84 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
const level = process.env.NODE_ENV === 'production' ? 2 : 1
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
],
parserOptions: {
parser: 'babel-eslint',
},
rules: {
// 'import/no-unresolved': 0,
// 'import/newline-after-import': 0,
// 'import/imports-first': 0,
// 'import/extensions': 0,
// 'import/no-dynamic-require': 0,
// 'import/no-extraneous-dependencies': 0,
// 'import/prefer-default-export': 0,
// 'import/no-named-as-default': 0,
// 'import/no-webpack-loader-syntax': 0,
// 关闭的规则
'vue/script-indent': 0,
'import/extensions': 0,
'import/prefer-default-export': 0,
'arrow-parens': 0,
'arrow-body-style': 0,
'consistent-return': 0,
'function-paren-newline': 0,
'prefer-destructuring': 0,
'prefer-promise-reject-errors': 0,
'no-return-assign': 0,
semi: 0,
// 开发时关闭的规则
'vue/html-indent': [level, 2, { baseIndent: 0, closeBracket: 1, alignAttributesVertically: false }],
'vue/no-unused-components': level,
'block-spacing': level,
'brace-style': level,
camelcase: level,
'comma-spacing': level,
'comma-dangle': level,
indent: [level, 2, { SwitchCase: 1 }],
'key-spacing': level,
'max-len': level,
'no-console': [level, { allow: ['warn', 'error', 'info'] }],
'no-debugger': level,
'no-empty': [level, { allowEmptyCatch: true }],
'no-mixed-operators': level,
'no-multiple-empty-lines': [level, { maxEOF: 2, max: 2, maxBOF: 1 }],
'no-multi-spaces': [level, { ignoreEOLComments: true }],
'no-param-reassign': level,
'no-underscore-dangle': level,
'no-unreachable': level,
'no-unused-vars': level,
'object-curly-newline': [level, { consistent: true }],
'prefer-const': level,
'padded-blocks': level,
'quote-props': level,
quotes: level,
'spaced-comment': level,
'space-before-blocks': level,
'space-before-function-paren': level,
'space-infix-ops': level,
// 'arrow-spacing': 1,
// camelcase: 0,
// 'comma-dangle': [1, 'only-multiline'],
// 'comma-spacing': 1,
// eqeqeq: 1,
// 'func-names': [1, 'never'],
// 'guard-for-in': 1,
// 'key-spacing': 1,
// 'keyword-spacing': 1,
// indent: [2, 2, { SwitchCase: 1 }],
// 'max-len': 1,
// 'new-cap': 1,
// 'newline-per-chained-call': 0,
// 'no-console': [
// level,
// {
// allow: ['warn', 'error', 'info'],
// },
// ],
// 'no-debugger': level,
// 'no-empty-function': 1,
// 'no-trailing-spaces': [2, {
// skipBlankLines: true
// }],
// 'no-new': 1,
// 'no-mixed-operators': 0,
// 'no-multiple-empty-lines': [1, { max: 2, maxEOF: 1, maxBOF: 1 }],
// 'no-multi-str': 0,
// 'no-multi-spaces': [1, { ignoreEOLComments: true }],
// 'no-unused-vars': [2, { args: 'none' }],
// 'no-unused-expressions': [2, { allowShortCircuit: true }],
// 'no-underscore-dangle': [1, { allowAfterThis: true }],
// 'no-unneeded-ternary': 1,
// 'no-restricted-syntax': [1, 'DebuggerStatement'],
// 'no-plusplus': [1, { allowForLoopAfterthoughts: true }],
// 'no-param-reassign': 0,
// 'no-shadow': 0,
// 'object-shorthand': 0,
// 'object-curly-spacing': 1,
// 'object-curly-newline': [1, { consistent: true }],
// 'operator-linebreak': 0,
// 'one-var': 1,
// 'one-var-declaration-per-line': [1, 'initializations'],
// 'prefer-arrow-callback': 0,
// 'prefer-spread': 1,
// quotes: [1, 'single', {
// avoidEscape: true,
// allowTemplateLiterals: true
// }],
// 'quote-props': 1,
// radix: [1, 'as-needed'],
// 'spaced-comment': 1,
// 'space-infix-ops': 1,
// semi: 0,
// 'space-before-function-paren': [1, 'never'],
// 'space-before-blocks': 1,
},
};