@innovixx/eslint-config 3.0.13 → 4.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +370 -20
- package/config/configs/base/index.mjs +40 -40
- package/config/configs/base/rules/best-practices.mjs +331 -333
- package/config/configs/base/rules/errors.mjs +115 -115
- package/config/configs/base/rules/es6.mjs +176 -176
- package/config/configs/base/rules/imports.mjs +238 -238
- package/config/configs/base/rules/variables.mjs +31 -31
- package/config/configs/jest/index.mjs +19 -19
- package/config/configs/jest/rules/jest-dom.mjs +8 -8
- package/config/configs/jest/rules/jest.mjs +33 -33
- package/config/configs/react/index.mjs +31 -42
- package/config/configs/react/rules/custom-rules.mjs +332 -0
- package/config/configs/react/rules/react-a11y.mjs +227 -227
- package/config/configs/react/rules/react-hooks.mjs +6 -6
- package/config/configs/react/rules/react.mjs +49 -452
- package/config/configs/typescript/index.mjs +24 -24
- package/config/configs/typescript/rules/all.mjs +14 -14
- package/config/configs/typescript/settings/typescript.mjs +8 -11
- package/config/deepMerge.mjs +47 -47
- package/config/index.mjs +117 -117
- package/demo/components/ComponentTest/index.tsx +1 -1
- package/demo/components/ComponentTestWithProps/index.tsx +2 -2
- package/package.json +19 -20
- package/tsconfig.json +1 -1
|
@@ -1,161 +1,161 @@
|
|
|
1
1
|
/** @type {import('eslint').Linter.Config} */
|
|
2
2
|
|
|
3
3
|
const errorRules = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
rules: {
|
|
5
|
+
// Enforce “for” loop update clause moving the counter in the right direction
|
|
6
|
+
// https://eslint.org/docs/rules/for-direction
|
|
7
|
+
'for-direction': 'error',
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
// Enforces that a return statement is present in property getters
|
|
10
|
+
// https://eslint.org/docs/rules/getter-return
|
|
11
|
+
'getter-return': ['error', { allowImplicit: true }],
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
// disallow using an async function as a Promise executor
|
|
14
|
+
// https://eslint.org/docs/rules/no-async-promise-executor
|
|
15
|
+
'no-async-promise-executor': 'error',
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
// Disallow await inside of loops
|
|
18
|
+
// https://eslint.org/docs/rules/no-await-in-loop
|
|
19
|
+
'no-await-in-loop': 'error',
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
// Disallow comparisons to negative zero
|
|
22
|
+
// https://eslint.org/docs/rules/no-compare-neg-zero
|
|
23
|
+
'no-compare-neg-zero': 'error',
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
// disallow assignment in conditional expressions
|
|
26
|
+
'no-cond-assign': ['error', 'always'],
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// disallow use of console
|
|
29
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// disallow use of constant expressions in conditions
|
|
32
|
+
'no-constant-condition': 'warn',
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
// disallow control characters in regular expressions
|
|
35
|
+
'no-control-regex': 'error',
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
// disallow use of debugger
|
|
38
|
+
'no-debugger': 'error',
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
// disallow duplicate arguments in functions
|
|
41
|
+
'no-dupe-args': 'error',
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
// Disallow duplicate conditions in if-else-if chains
|
|
44
|
+
// https://eslint.org/docs/rules/no-dupe-else-if
|
|
45
|
+
// TODO: enable, semver-major
|
|
46
|
+
'no-dupe-else-if': 'off',
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
// disallow duplicate keys when creating object literals
|
|
49
|
+
'no-dupe-keys': 'error',
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
// disallow a duplicate case label.
|
|
52
|
+
'no-duplicate-case': 'error',
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
// disallow empty statements
|
|
55
|
+
'no-empty': 'error',
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
// disallow the use of empty character classes in regular expressions
|
|
58
|
+
'no-empty-character-class': 'error',
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
// disallow assigning to the exception in a catch block
|
|
61
|
+
'no-ex-assign': 'error',
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
// disallow double-negation boolean casts in a boolean context
|
|
64
|
+
// https://eslint.org/docs/rules/no-extra-boolean-cast
|
|
65
|
+
'no-extra-boolean-cast': 'error',
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
// disallow unnecessary parentheses
|
|
68
|
+
// https://eslint.org/docs/rules/no-extra-parens
|
|
69
|
+
'no-extra-parens': ['off', 'all', {
|
|
70
|
+
conditionalAssign: true,
|
|
71
|
+
nestedBinaryExpressions: false,
|
|
72
|
+
returnAssign: false,
|
|
73
|
+
ignoreJSX: 'all', // delegate to eslint-plugin-react
|
|
74
|
+
enforceForArrowConditionals: false,
|
|
75
|
+
}],
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
// disallow unnecessary semicolons
|
|
78
|
+
'no-extra-semi': 'error',
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
// disallow overwriting functions written as function declarations
|
|
81
|
+
'no-func-assign': 'error',
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
// https://eslint.org/docs/rules/no-import-assign
|
|
84
|
+
// TODO: enable, semver-minor, once eslint v6.4 is required (which is a major)
|
|
85
|
+
'no-import-assign': 'off',
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
// disallow function or variable declarations in nested blocks
|
|
88
|
+
'no-inner-declarations': 'error',
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
// disallow invalid regular expression strings in the RegExp constructor
|
|
91
|
+
'no-invalid-regexp': 'error',
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
// disallow irregular whitespace outside of strings and comments
|
|
94
|
+
'no-irregular-whitespace': 'error',
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
// Disallow characters which are made with multiple code points in character class syntax
|
|
97
|
+
// https://eslint.org/docs/rules/no-misleading-character-class
|
|
98
|
+
'no-misleading-character-class': 'error',
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// disallow the use of object properties of the global object (Math and JSON) as functions
|
|
101
|
+
'no-obj-calls': 'error',
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
// disallow use of Object.prototypes builtins directly
|
|
104
|
+
// https://eslint.org/docs/rules/no-prototype-builtins
|
|
105
|
+
'no-prototype-builtins': 'error',
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
// disallow multiple spaces in a regular expression literal
|
|
108
|
+
'no-regex-spaces': 'error',
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
// Disallow returning values from setters
|
|
111
|
+
// https://eslint.org/docs/rules/no-setter-return
|
|
112
|
+
// TODO: enable, semver-major (altho the guide forbids getters/setters already)
|
|
113
|
+
'no-setter-return': 'off',
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
// disallow sparse arrays
|
|
116
|
+
'no-sparse-arrays': 'error',
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
// Disallow template literal placeholder syntax in regular strings
|
|
119
|
+
// https://eslint.org/docs/rules/no-template-curly-in-string
|
|
120
|
+
'no-template-curly-in-string': 'error',
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
// Avoid code that looks like two expressions but is actually one
|
|
123
|
+
// https://eslint.org/docs/rules/no-unexpected-multiline
|
|
124
|
+
'no-unexpected-multiline': 'error',
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
// disallow unreachable statements after a return, throw, continue, or break statement
|
|
127
|
+
'no-unreachable': 'error',
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
// disallow return/throw/break/continue inside finally blocks
|
|
130
|
+
// https://eslint.org/docs/rules/no-unsafe-finally
|
|
131
|
+
'no-unsafe-finally': 'error',
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
// disallow negating the left operand of relational operators
|
|
134
|
+
// https://eslint.org/docs/rules/no-unsafe-negation
|
|
135
|
+
'no-unsafe-negation': 'error',
|
|
136
|
+
// disallow negation of the left operand of an in expression
|
|
137
|
+
// deprecated in favor of no-unsafe-negation
|
|
138
|
+
'no-negated-in-lhs': 'off',
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
// disallow useless backreferences in regular expressions
|
|
141
|
+
'no-useless-backreference': 'off',
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
// Disallow assignments that can lead to race conditions due to usage of await or yield
|
|
144
|
+
// https://eslint.org/docs/rules/require-atomic-updates
|
|
145
|
+
// TODO: enable, semver-major
|
|
146
|
+
'require-atomic-updates': 'off',
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
// disallow comparisons with the value NaN
|
|
149
|
+
'use-isnan': 'error',
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
// ensure JSDoc comments are valid
|
|
152
|
+
// https://eslint.org/docs/rules/valid-jsdoc
|
|
153
|
+
'valid-jsdoc': 'off',
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
// ensure that the results of typeof are compared against a valid string
|
|
156
|
+
// https://eslint.org/docs/rules/valid-typeof
|
|
157
|
+
'valid-typeof': ['error', { requireStringLiterals: true }],
|
|
158
|
+
},
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
export default errorRules;
|
|
@@ -3,182 +3,182 @@ import globals from 'globals';
|
|
|
3
3
|
/** @type {import('eslint').Linter.Config} */
|
|
4
4
|
|
|
5
5
|
const es6Rules = {
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
6
|
+
languageOptions: {
|
|
7
|
+
globals: {
|
|
8
|
+
...globals.es2015,
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaVersion: 'latest',
|
|
13
|
+
sourceType: 'module',
|
|
14
|
+
ecmaFeatures: {
|
|
15
|
+
generators: false,
|
|
16
|
+
objectLiteralDuplicateProperties: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
// enforces no braces where they can be omitted
|
|
21
|
+
// https://eslint.org/docs/rules/arrow-body-style
|
|
22
|
+
'arrow-body-style': ['error', 'as-needed', {
|
|
23
|
+
requireReturnForObjectLiteral: false,
|
|
24
|
+
}],
|
|
25
|
+
|
|
26
|
+
// require parens in arrow function arguments
|
|
27
|
+
// https://eslint.org/docs/rules/arrow-parens
|
|
28
|
+
'arrow-parens': ['error', 'always'],
|
|
29
|
+
|
|
30
|
+
// require space before/after arrow function's arrow
|
|
31
|
+
// https://eslint.org/docs/rules/arrow-spacing
|
|
32
|
+
'arrow-spacing': ['error', { before: true, after: true }],
|
|
33
|
+
|
|
34
|
+
// verify super() callings in constructors
|
|
35
|
+
'constructor-super': 'error',
|
|
36
|
+
|
|
37
|
+
// enforce the spacing around the * in generator functions
|
|
38
|
+
// https://eslint.org/docs/rules/generator-star-spacing
|
|
39
|
+
'generator-star-spacing': ['error', { before: false, after: true }],
|
|
40
|
+
|
|
41
|
+
// disallow modifying variables of class declarations
|
|
42
|
+
// https://eslint.org/docs/rules/no-class-assign
|
|
43
|
+
'no-class-assign': 'error',
|
|
44
|
+
|
|
45
|
+
// disallow arrow functions where they could be confused with comparisons
|
|
46
|
+
// https://eslint.org/docs/rules/no-confusing-arrow
|
|
47
|
+
'no-confusing-arrow': ['error', {
|
|
48
|
+
allowParens: true,
|
|
49
|
+
}],
|
|
50
|
+
|
|
51
|
+
// disallow modifying variables that are declared using const
|
|
52
|
+
'no-const-assign': 'error',
|
|
53
|
+
|
|
54
|
+
// disallow duplicate class members
|
|
55
|
+
// https://eslint.org/docs/rules/no-dupe-class-members
|
|
56
|
+
'no-dupe-class-members': 'error',
|
|
57
|
+
|
|
58
|
+
// disallow importing from the same path more than once
|
|
59
|
+
// https://eslint.org/docs/rules/no-duplicate-imports
|
|
60
|
+
// replaced by https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
61
|
+
'no-duplicate-imports': 'off',
|
|
62
|
+
|
|
63
|
+
// disallow symbol constructor
|
|
64
|
+
// https://eslint.org/docs/rules/no-new-symbol
|
|
65
|
+
'no-new-symbol': 'error',
|
|
66
|
+
|
|
67
|
+
// disallow specific imports
|
|
68
|
+
// https://eslint.org/docs/rules/no-restricted-imports
|
|
69
|
+
'no-restricted-imports': ['off', {
|
|
70
|
+
paths: [],
|
|
71
|
+
patterns: [],
|
|
72
|
+
}],
|
|
73
|
+
|
|
74
|
+
// disallow to use this/super before super() calling in constructors.
|
|
75
|
+
// https://eslint.org/docs/rules/no-this-before-super
|
|
76
|
+
'no-this-before-super': 'error',
|
|
77
|
+
|
|
78
|
+
// disallow useless computed property keys
|
|
79
|
+
// https://eslint.org/docs/rules/no-useless-computed-key
|
|
80
|
+
'no-useless-computed-key': 'error',
|
|
81
|
+
|
|
82
|
+
// disallow unnecessary constructor
|
|
83
|
+
// https://eslint.org/docs/rules/no-useless-constructor
|
|
84
|
+
'no-useless-constructor': 'error',
|
|
85
|
+
|
|
86
|
+
// disallow renaming import, export, and destructured assignments to the same name
|
|
87
|
+
// https://eslint.org/docs/rules/no-useless-rename
|
|
88
|
+
'no-useless-rename': ['error', {
|
|
89
|
+
ignoreDestructuring: false,
|
|
90
|
+
ignoreImport: false,
|
|
91
|
+
ignoreExport: false,
|
|
92
|
+
}],
|
|
93
|
+
|
|
94
|
+
// require let or const instead of var
|
|
95
|
+
'no-var': 'error',
|
|
96
|
+
|
|
97
|
+
// require method and property shorthand syntax for object literals
|
|
98
|
+
// https://eslint.org/docs/rules/object-shorthand
|
|
99
|
+
'object-shorthand': ['error', 'always', {
|
|
100
|
+
ignoreConstructors: false,
|
|
101
|
+
avoidQuotes: true,
|
|
102
|
+
}],
|
|
103
|
+
|
|
104
|
+
// suggest using arrow functions as callbacks
|
|
105
|
+
'prefer-arrow-callback': ['error', {
|
|
106
|
+
allowNamedFunctions: false,
|
|
107
|
+
allowUnboundThis: true,
|
|
108
|
+
}],
|
|
109
|
+
|
|
110
|
+
// suggest using of const declaration for variables that are never modified after declared
|
|
111
|
+
'prefer-const': ['error', {
|
|
112
|
+
destructuring: 'any',
|
|
113
|
+
ignoreReadBeforeAssign: true,
|
|
114
|
+
}],
|
|
115
|
+
|
|
116
|
+
// Prefer destructuring from arrays and objects
|
|
117
|
+
// https://eslint.org/docs/rules/prefer-destructuring
|
|
118
|
+
'prefer-destructuring': ['error',
|
|
119
|
+
{
|
|
120
|
+
VariableDeclarator: {
|
|
121
|
+
array: false,
|
|
122
|
+
object: true,
|
|
123
|
+
},
|
|
124
|
+
AssignmentExpression: {
|
|
125
|
+
array: true,
|
|
126
|
+
object: false,
|
|
127
|
+
},
|
|
128
|
+
}, {
|
|
129
|
+
enforceForRenamedProperties: false,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
|
|
133
|
+
// disallow parseInt() in favor of binary, octal, and hexadecimal literals
|
|
134
|
+
// https://eslint.org/docs/rules/prefer-numeric-literals
|
|
135
|
+
'prefer-numeric-literals': 'error',
|
|
136
|
+
|
|
137
|
+
// suggest using Reflect methods where applicable
|
|
138
|
+
// https://eslint.org/docs/rules/prefer-reflect
|
|
139
|
+
'prefer-reflect': 'off',
|
|
140
|
+
|
|
141
|
+
// use rest parameters instead of arguments
|
|
142
|
+
// https://eslint.org/docs/rules/prefer-rest-params
|
|
143
|
+
'prefer-rest-params': 'error',
|
|
144
|
+
|
|
145
|
+
// suggest using the spread operator instead of .apply()
|
|
146
|
+
// https://eslint.org/docs/rules/prefer-spread
|
|
147
|
+
'prefer-spread': 'error',
|
|
148
|
+
|
|
149
|
+
// suggest using template literals instead of string concatenation
|
|
150
|
+
// https://eslint.org/docs/rules/prefer-template
|
|
151
|
+
'prefer-template': 'error',
|
|
152
|
+
|
|
153
|
+
// disallow generator functions that do not have yield
|
|
154
|
+
// https://eslint.org/docs/rules/require-yield
|
|
155
|
+
'require-yield': 'error',
|
|
156
|
+
|
|
157
|
+
// enforce spacing between object rest-spread
|
|
158
|
+
// https://eslint.org/docs/rules/rest-spread-spacing
|
|
159
|
+
'rest-spread-spacing': ['error', 'never'],
|
|
160
|
+
|
|
161
|
+
// import sorting
|
|
162
|
+
// https://eslint.org/docs/rules/sort-imports
|
|
163
|
+
'sort-imports': ['off', {
|
|
164
|
+
ignoreCase: false,
|
|
165
|
+
ignoreDeclarationSort: false,
|
|
166
|
+
ignoreMemberSort: false,
|
|
167
|
+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
168
|
+
}],
|
|
169
|
+
|
|
170
|
+
// require a Symbol description
|
|
171
|
+
// https://eslint.org/docs/rules/symbol-description
|
|
172
|
+
'symbol-description': 'error',
|
|
173
|
+
|
|
174
|
+
// enforce usage of spacing in template strings
|
|
175
|
+
// https://eslint.org/docs/rules/template-curly-spacing
|
|
176
|
+
'template-curly-spacing': 'error',
|
|
177
|
+
|
|
178
|
+
// enforce spacing around the * in yield* expressions
|
|
179
|
+
// https://eslint.org/docs/rules/yield-star-spacing
|
|
180
|
+
'yield-star-spacing': ['error', 'after'],
|
|
181
|
+
},
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
export default es6Rules;
|