-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
76 lines (61 loc) · 1.64 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
module.exports = {
root: true,
env: {
node: true,
browser: true,
'jest/globals': true
},
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
extends: [
'standard',
'plugin:import/errors',
'plugin:import/warnings',
],
plugins: [
'jest'
],
rules: {
// Enforce import order
'import/order': 2,
// Imports should come first
'import/first': 2,
// Other import rules
'import/no-mutable-exports': 2,
// Allow unresolved imports
'import/no-unresolved': 0,
// Allow paren-less arrow functions only when there's no braces
'arrow-parens': [2, 'as-needed', { requireForBlockBody: true }],
// Allow async-await
'generator-star-spacing': 0,
// Allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 1,
'no-console': process.env.NODE_ENV === 'production' ? 2 : 1,
// Prefer const over let
'prefer-const': [2, {
'destructuring': 'any',
'ignoreReadBeforeAssign': false
}],
// No single if in an else block
'no-lonely-if': 2,
// Force curly braces for control flow,
// including if blocks with a single statement
curly: [2, 'all'],
// No async function without await
'require-await': 2,
// Force dot notation when possible
'dot-notation': 2,
'no-var': 2,
// Force object shorthand where possible
'object-shorthand': 2,
// No useless destructuring/importing/exporting renames
'no-useless-rename': 2,
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
}
}