@ornikar/eslint-config 22.7.4 → 23.0.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/rules/unicorn.js CHANGED
@@ -1,61 +1,58 @@
1
1
  'use strict';
2
2
 
3
- const unicornPlugin = require('eslint-plugin-unicorn');
3
+ module.exports = {
4
+ plugins: ['unicorn'],
5
+ rules: {
6
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md
7
+ 'unicorn/catch-error-name': 'error',
4
8
 
5
- module.exports = [
6
- {
7
- plugins: { unicorn: unicornPlugin },
8
- rules: {
9
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md
10
- 'unicorn/catch-error-name': 'error',
9
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md
10
+ 'unicorn/explicit-length-check': 'error',
11
11
 
12
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md
13
- 'unicorn/explicit-length-check': 'error',
12
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
13
+ 'unicorn/filename-case': 'off',
14
14
 
15
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
16
- 'unicorn/filename-case': 'off',
15
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md
16
+ 'unicorn/no-abusive-eslint-disable': 'error',
17
17
 
18
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md
19
- 'unicorn/no-abusive-eslint-disable': 'error',
18
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
19
+ 'unicorn/no-process-exit': 'error',
20
20
 
21
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
22
- 'unicorn/no-process-exit': 'error',
21
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
22
+ 'unicorn/throw-new-error': 'error',
23
23
 
24
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
25
- 'unicorn/throw-new-error': 'error',
24
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
25
+ 'unicorn/number-literal-case': 'error',
26
26
 
27
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
28
- 'unicorn/number-literal-case': 'error',
27
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
28
+ 'unicorn/escape-case': 'error',
29
29
 
30
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
31
- 'unicorn/escape-case': 'error',
30
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md
31
+ 'unicorn/no-instanceof-array': 'error',
32
32
 
33
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md
34
- 'unicorn/no-instanceof-array': 'error',
33
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
34
+ 'unicorn/no-new-buffer': 'error',
35
35
 
36
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
37
- 'unicorn/no-new-buffer': 'error',
36
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-hex-escape.md
37
+ 'unicorn/no-hex-escape': 'error',
38
38
 
39
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-hex-escape.md
40
- 'unicorn/no-hex-escape': 'error',
39
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md
40
+ 'unicorn/custom-error-definition': 'error',
41
41
 
42
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md
43
- 'unicorn/custom-error-definition': 'error',
42
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md
43
+ 'unicorn/prefer-string-starts-ends-with': 'error',
44
44
 
45
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md
46
- 'unicorn/prefer-string-starts-ends-with': 'error',
45
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
46
+ 'unicorn/prefer-type-error': 'error',
47
47
 
48
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
49
- 'unicorn/prefer-type-error': 'error',
48
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md
49
+ 'unicorn/prefer-keyboard-event-key': 'off',
50
50
 
51
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md
52
- 'unicorn/prefer-keyboard-event-key': 'off',
51
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md
52
+ 'unicorn/prefer-array-flat-map': 'error',
53
53
 
54
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md
55
- 'unicorn/prefer-array-flat-map': 'error',
56
-
57
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md
58
- /* Can cause issues:
54
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md
55
+ /* Can cause issues:
59
56
  ```
60
57
  const formTree = shallow(tree.find(FormWithApiCall).prop('children')());
61
58
  ```
@@ -66,263 +63,262 @@ results in:
66
63
  const formTree = shallow(tree.find(x => FormWithApiCall(x)).prop('children')());
67
64
  ```
68
65
  */
69
- 'unicorn/no-array-callback-reference': 'off',
66
+ 'unicorn/no-array-callback-reference': 'off',
70
67
 
71
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-index.md
72
- 'unicorn/import-index': 'error',
68
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-index.md
69
+ 'unicorn/import-index': 'error',
73
70
 
74
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
75
- 'unicorn/new-for-builtins': 'error',
71
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
72
+ 'unicorn/new-for-builtins': 'error',
76
73
 
77
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/regex-shorthand.md
78
- 'unicorn/regex-shorthand': 'error',
74
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/regex-shorthand.md
75
+ 'unicorn/regex-shorthand': 'error',
79
76
 
80
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
81
- 'unicorn/prefer-spread': 'error',
77
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
78
+ 'unicorn/prefer-spread': 'error',
82
79
 
83
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
84
- 'unicorn/error-message': 'error',
80
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
81
+ 'unicorn/error-message': 'error',
85
82
 
86
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
87
- 'unicorn/prefer-add-event-listener': 'error',
83
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
84
+ 'unicorn/prefer-add-event-listener': 'error',
88
85
 
89
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-exponentiation-operator.md
90
- 'unicorn/prefer-exponentiation-operator': 'error',
86
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-exponentiation-operator.md
87
+ 'unicorn/prefer-exponentiation-operator': 'error',
91
88
 
92
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
93
- 'unicorn/prevent-abbreviations': 'off',
89
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
90
+ 'unicorn/prevent-abbreviations': 'off',
94
91
 
95
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
96
- 'unicorn/no-for-loop': 'off',
92
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
93
+ 'unicorn/no-for-loop': 'off',
97
94
 
98
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md
99
- 'unicorn/no-zero-fractions': 'error',
95
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md
96
+ 'unicorn/no-zero-fractions': 'error',
100
97
 
101
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md
102
- 'unicorn/prefer-includes': 'error',
98
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md
99
+ 'unicorn/prefer-includes': 'error',
103
100
 
104
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
105
- 'unicorn/prefer-dom-node-text-content': 'error',
101
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
102
+ 'unicorn/prefer-dom-node-text-content': 'error',
106
103
 
107
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-remove.md
108
- 'unicorn/prefer-node-remove': 'error',
104
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-remove.md
105
+ 'unicorn/prefer-node-remove': 'error',
109
106
 
110
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-keyword-prefix.md
111
- 'unicorn/no-keyword-prefix': 'off',
107
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-keyword-prefix.md
108
+ 'unicorn/no-keyword-prefix': 'off',
112
109
 
113
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/expiring-todo-comments.md
114
- 'unicorn/expiring-todo-comments': [
115
- 'error',
116
- {
117
- allowWarningComments: false,
118
- ignoreDatesOnPullRequests: true,
119
- ignore: [
120
- /(\[https:\/\/ornikar.atlassian.net\/browse\/[A-Z]+-\d+])/i, // JIRA issue format (ex: https://ornikar.atlassian.net/browse/DR-123)
121
- // TODO [eslint-plugin-unicorn>=64]: remove both lines. This is a known bug where Unicorn flags lowercase and every other todo as errors (https://github.com/sindresorhus/eslint-plugin-unicorn/pull/2828).
122
- /^\s*eslint-(?:disable|enable)/,
123
- /github\.com\/sindresorhus\/eslint-plugin-unicorn/,
124
- ],
125
- date: '9999-12-31', // invalidates all expiring dates <9999-12-31
126
- },
127
- ],
110
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/expiring-todo-comments.md
111
+ 'unicorn/expiring-todo-comments': [
112
+ 'error',
113
+ {
114
+ allowWarningComments: false,
115
+ ignoreDatesOnPullRequests: true,
116
+ ignore: [
117
+ /(\[https:\/\/ornikar.atlassian.net\/browse\/[A-Z]+-\d+])/i, // JIRA issue format (ex: https://ornikar.atlassian.net/browse/DR-123)
118
+ // TODO [eslint-plugin-unicorn>=64]: remove both lines. This is a known bug where Unicorn flags lowercase and every other todo as errors (https://github.com/sindresorhus/eslint-plugin-unicorn/pull/2828).
119
+ /^\s*eslint-(?:disable|enable)/,
120
+ /github\.com\/sindresorhus\/eslint-plugin-unicorn/,
121
+ ],
122
+ date: '9999-12-31', // invalidates all expiring dates <9999-12-31
123
+ },
124
+ ],
128
125
 
129
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md
130
- 'no-nested-ternary': 'off',
131
- 'unicorn/no-nested-ternary': 'error',
126
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md
127
+ 'no-nested-ternary': 'off',
128
+ 'unicorn/no-nested-ternary': 'error',
132
129
 
133
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
134
- 'unicorn/consistent-function-scoping': 'off',
130
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
131
+ 'unicorn/consistent-function-scoping': 'off',
135
132
 
136
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-reflect-apply.md
137
- 'unicorn/prefer-reflect-apply': 'off',
133
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-reflect-apply.md
134
+ 'unicorn/prefer-reflect-apply': 'off',
138
135
 
139
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md
140
- 'unicorn/prefer-dom-node-dataset': 'error',
136
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md
137
+ 'unicorn/prefer-dom-node-dataset': 'error',
141
138
 
142
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
143
- 'unicorn/prefer-string-slice': 'error',
139
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
140
+ 'unicorn/prefer-string-slice': 'error',
144
141
 
145
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-trim-start-end.md
146
- 'unicorn/prefer-string-trim-start-end': 'error',
142
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-trim-start-end.md
143
+ 'unicorn/prefer-string-trim-start-end': 'error',
147
144
 
148
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
149
- 'unicorn/prefer-negative-index': 'error',
145
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
146
+ 'unicorn/prefer-negative-index': 'error',
150
147
 
151
- /* Decide to enable or not */
148
+ /* Decide to enable or not */
152
149
 
153
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md
154
- 'unicorn/prefer-modern-dom-apis': 'off',
150
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md
151
+ 'unicorn/prefer-modern-dom-apis': 'off',
155
152
 
156
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
157
- 'unicorn/prefer-string-replace-all': 'off',
153
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
154
+ 'unicorn/prefer-string-replace-all': 'off',
158
155
 
159
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/string-content.md
160
- 'unicorn/string-content': 'off',
156
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/string-content.md
157
+ 'unicorn/string-content': 'off',
161
158
 
162
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
163
- 'unicorn/prefer-number-properties': 'off',
159
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
160
+ 'unicorn/prefer-number-properties': 'off',
164
161
 
165
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md
166
- 'unicorn/prefer-set-has': 'off',
162
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md
163
+ 'unicorn/prefer-set-has': 'off',
167
164
 
168
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
169
- 'unicorn/prefer-optional-catch-binding': 'off',
165
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
166
+ 'unicorn/prefer-optional-catch-binding': 'off',
170
167
 
171
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md
172
- 'unicorn/no-useless-undefined': 'off',
168
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md
169
+ 'unicorn/no-useless-undefined': 'off',
173
170
 
174
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-find.md
175
- 'unicorn/prefer-array-find': 'off',
171
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-find.md
172
+ 'unicorn/prefer-array-find': 'off',
176
173
 
177
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
178
- 'unicorn/no-array-reduce': ['error', { allowSimpleOperations: true }],
174
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
175
+ 'unicorn/no-array-reduce': ['error', { allowSimpleOperations: true }],
179
176
 
180
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-style.md
181
- 'unicorn/import-style': 'off',
177
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-style.md
178
+ 'unicorn/import-style': 'off',
182
179
 
183
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md
184
- 'unicorn/prefer-math-trunc': 'off',
180
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md
181
+ 'unicorn/prefer-math-trunc': 'off',
185
182
 
186
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
187
- 'unicorn/numeric-separators-style': 'off',
183
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
184
+ 'unicorn/numeric-separators-style': 'off',
188
185
 
189
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md
190
- 'unicorn/prefer-ternary': 'off',
186
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md
187
+ 'unicorn/prefer-ternary': 'off',
191
188
 
192
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md
193
- 'unicorn/no-lonely-if': 'off',
189
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md
190
+ 'unicorn/no-lonely-if': 'off',
194
191
 
195
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md
196
- 'unicorn/empty-brace-spaces': 'off',
192
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md
193
+ 'unicorn/empty-brace-spaces': 'off',
197
194
 
198
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-date-now.md
199
- 'unicorn/prefer-date-now': 'error',
195
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-date-now.md
196
+ 'unicorn/prefer-date-now': 'error',
200
197
 
201
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-some.md
202
- 'unicorn/prefer-array-some': 'error',
198
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-some.md
199
+ 'unicorn/prefer-array-some': 'error',
203
200
 
204
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md
205
- 'unicorn/prefer-default-parameters': 'error',
201
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md
202
+ 'unicorn/prefer-default-parameters': 'error',
206
203
 
207
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
208
- 'unicorn/no-new-array': 'error',
204
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
205
+ 'unicorn/no-new-array': 'error',
209
206
 
210
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
211
- 'unicorn/prefer-array-index-of': 'error',
207
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
208
+ 'unicorn/prefer-array-index-of': 'error',
212
209
 
213
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md
214
- 'unicorn/prefer-regexp-test': 'error',
210
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md
211
+ 'unicorn/prefer-regexp-test': 'error',
215
212
 
216
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-destructuring.md
217
- 'unicorn/consistent-destructuring': 'off',
213
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-destructuring.md
214
+ 'unicorn/consistent-destructuring': 'off',
218
215
 
219
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
220
- 'unicorn/no-array-for-each': 'off',
216
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
217
+ 'unicorn/no-array-for-each': 'off',
221
218
 
222
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md
223
- 'unicorn/no-array-push-push': 'error',
219
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md
220
+ 'unicorn/no-array-push-push': 'error',
224
221
 
225
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-assignment.md
226
- 'unicorn/no-this-assignment': 'off',
222
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-assignment.md
223
+ 'unicorn/no-this-assignment': 'off',
227
224
 
228
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-static-only-class.md
229
- 'unicorn/no-static-only-class': 'off',
225
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-static-only-class.md
226
+ 'unicorn/no-static-only-class': 'off',
230
227
 
231
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat.md
232
- 'unicorn/prefer-array-flat': 'off',
228
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat.md
229
+ 'unicorn/prefer-array-flat': 'off',
233
230
 
234
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md
235
- 'unicorn/prefer-switch': 'error',
231
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md
232
+ 'unicorn/prefer-switch': 'error',
236
233
 
237
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
238
- 'unicorn/prefer-node-protocol': 'error',
234
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
235
+ 'unicorn/prefer-node-protocol': 'error',
239
236
 
240
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md
241
- 'unicorn/prefer-module': 'off',
237
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md
238
+ 'unicorn/prefer-module': 'off',
242
239
 
243
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md
244
- 'unicorn/prefer-at': 'off',
240
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md
241
+ 'unicorn/prefer-at': 'off',
245
242
 
246
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md
247
- 'unicorn/no-empty-file': 'off',
243
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md
244
+ 'unicorn/no-empty-file': 'off',
248
245
 
249
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md
250
- 'unicorn/prefer-export-from': 'error',
246
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md
247
+ 'unicorn/prefer-export-from': 'error',
251
248
 
252
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-code-point.md
253
- 'unicorn/prefer-code-point': 'error',
249
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-code-point.md
250
+ 'unicorn/prefer-code-point': 'error',
254
251
 
255
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-expression-member.md
256
- 'unicorn/no-await-expression-member': 'off',
252
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-expression-member.md
253
+ 'unicorn/no-await-expression-member': 'off',
257
254
 
258
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md
259
- 'unicorn/no-unnecessary-await': 'error',
255
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md
256
+ 'unicorn/no-unnecessary-await': 'error',
260
257
 
261
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-from-entries.md
262
- 'unicorn/prefer-object-from-entries': 'error',
258
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-from-entries.md
259
+ 'unicorn/prefer-object-from-entries': 'error',
263
260
 
264
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md
265
- 'unicorn/no-useless-spread': 'error',
261
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md
262
+ 'unicorn/no-useless-spread': 'error',
266
263
 
267
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md
268
- 'unicorn/no-useless-length-check': 'error',
264
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md
265
+ 'unicorn/no-useless-length-check': 'error',
269
266
 
270
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-fallback-in-spread.md
271
- 'unicorn/no-useless-fallback-in-spread': 'error',
267
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-fallback-in-spread.md
268
+ 'unicorn/no-useless-fallback-in-spread': 'error',
272
269
 
273
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md
274
- 'unicorn/require-array-join-separator': 'error',
270
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md
271
+ 'unicorn/require-array-join-separator': 'error',
275
272
 
276
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-thenable.md
277
- 'unicorn/no-thenable': 'error',
273
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-thenable.md
274
+ 'unicorn/no-thenable': 'error',
278
275
 
279
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
280
- 'unicorn/no-useless-promise-resolve-reject': 'error',
276
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
277
+ 'unicorn/no-useless-promise-resolve-reject': 'error',
281
278
 
282
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/relative-url-style.md
283
- 'unicorn/relative-url-style': 'error',
279
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/relative-url-style.md
280
+ 'unicorn/relative-url-style': 'error',
284
281
 
285
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md
286
- 'unicorn/prefer-json-parse-buffer': 'error',
282
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md
283
+ 'unicorn/prefer-json-parse-buffer': 'error',
287
284
 
288
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md
289
- 'unicorn/text-encoding-identifier-case': 'error',
285
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md
286
+ 'unicorn/text-encoding-identifier-case': 'error',
290
287
 
291
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md
292
- 'unicorn/no-useless-switch-case': 'off',
288
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md
289
+ 'unicorn/no-useless-switch-case': 'off',
293
290
 
294
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
295
- 'unicorn/prefer-modern-math-apis': 'error',
291
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
292
+ 'unicorn/prefer-modern-math-apis': 'error',
296
293
 
297
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
298
- 'unicorn/no-unreadable-iife': 'error',
294
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
295
+ 'unicorn/no-unreadable-iife': 'error',
299
296
 
300
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md
301
- 'unicorn/prefer-native-coercion-functions': 'error',
297
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md
298
+ 'unicorn/prefer-native-coercion-functions': 'error',
302
299
 
303
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
304
- 'unicorn/prefer-logical-operator-over-ternary': 'error',
300
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
301
+ 'unicorn/prefer-logical-operator-over-ternary': 'error',
305
302
 
306
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md
307
- 'unicorn/no-array-method-this-argument': 'error',
303
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md
304
+ 'unicorn/no-array-method-this-argument': 'error',
308
305
 
309
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
310
- 'unicorn/no-invalid-remove-event-listener': 'error',
306
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
307
+ 'unicorn/no-invalid-remove-event-listener': 'error',
311
308
 
312
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md
313
- 'unicorn/require-number-to-fixed-digits-argument': 'error',
309
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md
310
+ 'unicorn/require-number-to-fixed-digits-argument': 'error',
314
311
 
315
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md
316
- 'unicorn/no-typeof-undefined': 'error',
312
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md
313
+ 'unicorn/no-typeof-undefined': 'error',
317
314
 
318
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
319
- 'unicorn/no-negated-condition': 'off',
315
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
316
+ 'unicorn/no-negated-condition': 'off',
320
317
 
321
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md
322
- 'unicorn/prefer-set-size': 'off',
318
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md
319
+ 'unicorn/prefer-set-size': 'off',
323
320
 
324
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
325
- 'unicorn/prefer-blob-reading-methods': 'off',
326
- },
321
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
322
+ 'unicorn/prefer-blob-reading-methods': 'off',
327
323
  },
328
- ];
324
+ };
package/tests-override.js CHANGED
@@ -1,22 +1,23 @@
1
1
  'use strict';
2
2
 
3
- const jestConfig = require('./rules/jest');
3
+ module.exports = {
4
+ env: {
5
+ jest: true,
6
+ },
7
+
8
+ extends: ['./rules/jest'].map(require.resolve),
4
9
 
5
- module.exports = [
6
- ...jestConfig,
7
- {
8
- rules: {
9
- // Allow to use devDependencies
10
- 'import/no-extraneous-dependencies': [
11
- 'error',
12
- {
13
- devDependencies: true,
14
- },
15
- ],
10
+ rules: {
11
+ // Allow to use devDependencies
12
+ 'import/no-extraneous-dependencies': [
13
+ 'error',
14
+ {
15
+ devDependencies: true,
16
+ },
17
+ ],
16
18
 
17
- // Allow non-literal fs filename for tests
18
- 'security/detect-non-literal-fs-filename': 'off',
19
- 'security/detect-non-literal-require': 'off',
20
- },
19
+ // Allow non-literal fs filename for tests
20
+ 'security/detect-non-literal-fs-filename': 'off',
21
+ 'security/detect-non-literal-require': 'off',
21
22
  },
22
- ];
23
+ };