-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
79 lines (78 loc) · 2.18 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
// http://eslint.org/docs/user-guide/configuring
const isProduction = process.env.NODE_ENV === 'production'
module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
ecmaFeatures: {
legacyDecorators: true
}
},
env: {
node: true
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
plugins: [
'@babel'
],
rules: {
'array-bracket-spacing': ['error', 'never'],
// Allow paren-less arrow functions.
'arrow-parens': ['error', 'as-needed'],
// Allow async-await.
'generator-star-spacing': 'off',
'indent': ['error', 2, {
flatTernaryExpressions: true
}],
'max-len': ['error', 80, 2, {
ignoreUrls: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true
}],
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-constant-condition': isProduction ? 'error' : 'warn',
// Allow debugger during development.
'no-debugger': isProduction ? 'error' : 'warn',
'no-mixed-operators': 'off',
'no-new': 'off',
'no-new-func': 'off',
'no-prototype-builtins': 'off',
'no-return-assign': 'error',
'no-this-before-super': 'error',
'no-undef': isProduction ? 'error' : 'warn',
'no-unreachable': isProduction ? 'error' : 'warn',
'no-unused-vars': [isProduction ? 'error' : 'warn', {
args: 'after-used',
argsIgnorePattern: '^_',
ignoreRestSiblings: true
}],
'no-var': 'error',
'object-shorthand': 'error',
'standard/object-curly-even-spacing': 'off',
'object-curly-spacing': ['error', 'always'],
'prefer-const': ['error', {
destructuring: 'all'
}],
'prefer-destructuring': ['error', {
VariableDeclarator: {
object: true,
array: false
}
}],
'quotes': ['error', 'single', {
allowTemplateLiterals: true,
avoidEscape: true
}],
'quote-props': ['error', 'consistent-as-needed'],
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
'space-in-parens': ['error', 'never']
}
}