generated from vueComponent/ant-design-vue-pro-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
58 lines (56 loc) · 1.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
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/strongly-recommended',
'@vue/standard',
],
parserOptions: {
parser: 'babel-eslint',
},
rules: {
// enUS: all rules docs https://eslint.org/docs/rules/
// zhCN: 所有规则文档 https://eslint.bootcss.com/docs/rules/
// 基础规则 全部 ES 项目通用
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'quote-props': 'off',
// 结尾必须有逗号(主要缓解增加一行对象属性,导致 git 变更记录是两行的情况)
'comma-dangle': ['error', 'always-multiline'],
// 逗号必须在一行的结尾
'comma-style': ['error', 'last'],
// 禁止混合使用不同的操作符 'error','off'
'no-mixed-operators': 'off',
// 禁止未使用过的变量 default: ['error', { vars: 'local' }]
'no-unused-vars': ['off'],
/* vue 项目专用 */
'vue/require-default-prop': 'warn',
'vue/singleline-html-element-content-newline': ['off'],
'vue/max-attributes-per-line': [
2,
{
'singleline': 5,
'multiline': {
'max': 1,
'allowFirstLine': false,
},
},
],
// bug fix
'template-curly-spacing': 'off',
indent: 'off',
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
],
}