@ornikar/eslint-config 22.7.3 → 22.7.4

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