-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
103 lines (91 loc) · 2.99 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
99
100
101
102
103
'use strict';
module.exports = {
env: {
es6: true,
node: true
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 11
},
rules: {
/*
* Possible Errors
* http://eslint.org/docs/rules/#possible-errors
* ---------------------------------------------
*/
'no-loss-of-precision': 'error',
'no-return-assign': 'error',
/*
* Best Practices
* http://eslint.org/docs/rules/#best-practices
* --------------------------------------------
*/
'consistent-return': 'error',
'default-case': 'error',
'default-case-last': 'error',
'default-param-last': 'error',
'guard-for-in': 'error',
'no-constructor-return': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'off',
'no-new-wrappers': 'error',
'no-param-reassign': 'error',
'no-throw-literal': 'error',
'prefer-promise-reject-errors': 'error',
radix: 'error',
'require-atomic-updates': 'error',
'require-await': 'error',
/*
* Strict Mode
* http://eslint.org/docs/rules/#strict-mode
* --------------------------------------------
*/
strict: 'error',
/*
* Stylistic Issues
* http://eslint.org/docs/rules/#stylistic-issues
* ----------------------------------------------
*/
camelcase: 'error',
'linebreak-style': ['error', 'unix'],
// This rule is enabled just to check for long comments,
// since Prettier cannot yet split comments which are too long.
// https://github.com/prettier/eslint-config-prettier#max-len
'max-len': ['error', { comments: 80, ignoreUrls: true }],
'new-cap': 'error',
'no-lonely-if': 'error',
'no-multi-assign': 'error',
'no-restricted-syntax': ['error', 'SequenceExpression'],
'nonblock-statement-body-position': 'error',
'prefer-exponentiation-operator': 'error',
semi: ['error', 'always'],
'sort-vars': 'error',
'spaced-comment': 'error',
/*
* EcmaScript 6
* https://eslint.org/docs/rules/#ecmascript-6
* -------------------------------------------
*/
// Do not enable this rule for now.
// https://github.com/prettier/eslint-config-prettier#arrow-body-style-and-prefer-arrow-callback
'arrow-body-style': 'off',
// This rule can be safely used with Prettier if 'allowParens' is false.
// https://github.com/prettier/eslint-config-prettier#no-confusing-arrow
'no-confusing-arrow': ['error', { allowParens: false }],
'no-var': 'error',
'object-shorthand': 'error',
// Do not enable this rule for now.
// https://github.com/prettier/eslint-config-prettier#arrow-body-style-and-prefer-arrow-callback
'prefer-arrow-callback': 'off',
'prefer-const': 'error',
'prefer-destructuring': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error'
}
};