-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
86 lines (69 loc) · 1.93 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
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
'jest/globals': true
},
globals: {
'_': true
},
plugins: ['jest'],
extends: [
'standard',
'plugin:import/errors',
'plugin:import/warnings',
"plugin:vue/essential",
"eslint:recommended"
],
settings: {
'import/resolver': {
node: { extensions: ['.js', '.mjs' ,'json', 'vue'] }
}
},
rules: {
/**********************/
/* General Code Rules */
/**********************/
// Enforce import order
'import/order': 'off',
// Imports should come first
'import/first': 'error',
// Other import rules
'import/no-mutable-exports': 'error',
// Allow unresolved imports
'import/no-unresolved': 'off',
// Allow paren-less arrow functions only when there's no braces
'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
// Allow async-await
'generator-star-spacing': 'off',
// Allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
// Prefer const over let
'prefer-const': ['error', {
destructuring: 'any',
ignoreReadBeforeAssign: false
}],
// No single if in an "else" block
'no-lonely-if': 'error',
// Force curly braces for control flow,
// including if blocks with a single statement
curly: ['error', 'all'],
// No async function without await
'require-await': 'error',
// Force dot notation when possible
'dot-notation': 'error',
'no-var': 'error',
// Force object shorthand where possible
'object-shorthand': 'error',
// No useless destructuring/importing/exporting renames
'no-useless-rename': 'error',
'no-useless-return': 'off',
'no-void': 'off'
}
}