-
Notifications
You must be signed in to change notification settings - Fork 13
/
.eslintrc.js
98 lines (97 loc) · 2.31 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
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
env: {
browser: true,
},
// required to lint *.vue files
plugins: [
'html'
],
// check if imports actually resolve
settings: {
'import/resolver': {
webpack: {
config: 'build/webpack.base.conf.js'
}
}
},
rules: {
// don't require .vue extension when importing
// 'import/extensions': ['error', 'always', {
// 'js': 'never',
// 'vue': 'never'
// }],
// allow optionalDependencies
// 'import/no-extraneous-dependencies': ['error', {
// 'optionalDependencies': ['test/unit/index.js']
// }],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-console': 0,
'no-control-regex': 0,
'no-alert': 1,
'no-else-return': 1,
'no-redeclare': 2,
'no-useless-escape': 1,
'no-inner-declarations': 0,
'array-bracket-spacing': ['warn', 'never'],
'brace-style': ['warn', '1tbs', {
allowSingleLine: true
}],
'no-trailing-spaces': 1,
'space-before-function-paren': ['warn', {
asyncArrow: 'always',
anonymous: 'never',
named: 'never'
}],
'arrow-spacing': 1,
'comma-spacing': ['warn', {
before: false,
after: true
}],
indent: ['error', 'tab', {
SwitchCase: 1
}],
'array-callback-return': 'error',
// 'consistent-return': 'error',
eqeqeq: ['warn', 'always', { null: 'ignore' }],
'no-empty-function': ['error', {
allow: [
'arrowFunctions',
'functions',
'methods',
]
}],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-return-assign': 'error',
'no-unmodified-loop-condition': 'off',
'no-dupe-keys': 'error',
'no-empty': 'error',
'no-extra-semi': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-regex-spaces': 'error',
'no-unreachable': 'error',
'valid-typeof': ['error', { requireStringLiterals: true }],
'constructor-super': 'error',
'no-const-assign': 'error',
'no-dupe-class-members': 'error',
'no-var': 'error',
'object-shorthand': ['error', 'always', {
ignoreConstructors: false,
avoidQuotes: true,
}],
'block-spacing': ['error', 'always'],
'eol-last': ['error', 'always'],
}
}