-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.js
73 lines (70 loc) · 2.24 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
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
jest: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
'rules': {
//"off"或0 -关闭规则
//"warn" 或1 - 开启规则, 使用警告 程序不会退出
//"error"或2 - 开启规则, 使用错误 程序退出
'indent': ['error', 4],
'vue/script-indent': ['error', 4, { 'baseIndent': 1 }],
//分号
'semi': 'off',
'spaced-comment': 'off',
'eqeqeq': 1,
'no-useless-escape': 'off',
'brace-style': 0,//大括号风格
'curly': 'off', //[2, "all"],//必须使用 if(){} 中的{}
'space-before-function-paren': ['off', 'always'],//函数定义时括号前面要不要有空格
'no-new': 'off',
'comma-dangle': 'off',//对象字面量项尾不能有逗号
'no-return-assign': 'warn',//return 语句中不能有赋值表达式
'eol-last': 0,
'no-multiple-empty-lines': 0,
//'quotes': 'off',
//'comma-spacing': 'off',
'handle-callback-err': 0,
'padded-blocks': 0,
'no-duplicate-imports': 0,
'operator-linebreak': 0,
'no-undef': 2,
'no-extend-native': 0,
'no-sequences': 0,
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': 2,
'no-eval': 0,
'standard/no-callback-literal': 1,
'node/no-deprecated-api': 1,
},
'overrides': [
{
'files': ['*.vue'],
'rules': {
'indent': 'off'
}
}
]
}