forked from jbaysolutions/vue-grid-layout
-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
.eslintrc.js
113 lines (103 loc) · 2.52 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
/* eslint-env node */
const config = {
root: true,
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'airbnb-base',
],
env: {
'vue/setup-compiler-macros': true,
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@babel/eslint-parser',
ecmaFeatures: {
jsx: true,
},
},
rules: {
// 修改的规则
'no-multi-spaces': [2, { ignoreEOLComments: true }],
// 关闭vue的规则
'vue/multi-word-component-names': 0,
'vue/no-v-text-v-html-on-component': 0,
// 关闭import规则
'import/extensions': 0,
'import/no-extraneous-dependencies': 0,
'import/no-dynamic-require': 0,
'import/no-unresolved': 0,
'import/prefer-default-export': 0,
// 关闭airbnb规则
'arrow-parens': 0,
'arrow-body-style': 0,
'consistent-return': 0,
'default-param-last': 0,
'default-case': 0,
'global-require': 0,
'object-curly-newline': 0,
'prefer-destructuring': 0,
radix: 0,
'max-len': 0,
'newline-per-chained-call': 0,
'no-bitwise': 0,
'no-console': 0,
'no-control-regex': 0,
'no-cond-assign': 0,
'no-continue': 0,
'no-lonely-if': 0,
'no-return-assign': 0,
'no-restricted-syntax': 0,
'no-param-reassign': 0,
'no-plusplus': 0,
'no-use-before-define': 0,
'no-multiple-empty-lines': 0,
'no-shadow': 0,
// 关闭其他规则
'prettier/prettier': 0,
camelcase: 0,
// 增加的规则
'no-debugger': 2,
},
ignorePatterns: [
'coverage/**',
'public/**',
'node_modules/**',
'old/**',
],
};
// 开发测试阶段降低规则要求
if (process.env.NODE_ENV !== 'production') {
Object.assign(config.rules, {
'vue/no-unused-vars': 1,
'vue/valid-template-root': 1,
'vue/return-in-computed-property': 1,
'vue/valid-v-for': 1,
'import/newline-after-import': 1,
'array-bracket-spacing': 1,
'brace-style': 1,
'block-spacing': 1,
'comma-dangle': 1,
'comma-spacing': 1,
indent: [1, 2, { SwitchCase: 1 }],
'key-spacing': 1,
'keyword-spacing': 1,
'operator-linebreak': 1,
'prefer-const': 1,
'padded-blocks': 1,
'quote-props': 1,
semi: 1,
'spaced-comment': 1,
'space-before-blocks': 1,
'space-before-function-paren': 1,
'space-infix-ops': 1,
'space-in-parens': 1,
'no-debugger': 1,
'no-empty': 1,
'no-empty-function': 1,
'no-unused-vars': 1,
'no-multi-spaces': [1, { ignoreEOLComments: true }],
'no-unreachable': 1,
});
}
module.exports = config;