zeno-config 0.1.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 +271 -0
- package/package.json +89 -0
- package/src/eslint/index.d.ts +124 -0
- package/src/eslint/index.js +373 -0
- package/src/eslint/rules/baseRules.js +753 -0
- package/src/eslint/rules/importPluginRules.js +200 -0
- package/src/eslint/rules/jsxA11yPluginRules.js +195 -0
- package/src/eslint/rules/nodePluginRules.js +128 -0
- package/src/eslint/rules/reactHooksPluginRules.js +27 -0
- package/src/eslint/rules/reactPluginRules.js +476 -0
- package/src/eslint/rules/reactYouMightNotNeedAnEffectPluginRules.js +21 -0
- package/src/eslint/rules/stylisticPluginRules.js +330 -0
- package/src/eslint/rules/typescriptPluginRules.js +533 -0
- package/src/eslint/rules/unicornPluginRules.js +441 -0
- package/src/extensions.d.ts +51 -0
- package/src/extensions.js +49 -0
- package/src/prettier.d.ts +4 -0
- package/src/prettier.js +16 -0
- package/src/tsconfig.base.json +31 -0
- package/src/tsconfig.react.json +13 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
const getUnicornPluginRules = () => {
|
|
2
|
+
return {
|
|
3
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
|
|
4
|
+
'unicorn/better-regex': 'warn',
|
|
5
|
+
|
|
6
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md
|
|
7
|
+
'unicorn/catch-error-name': 'off',
|
|
8
|
+
|
|
9
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-assert.md
|
|
10
|
+
'unicorn/consistent-assert': 'error',
|
|
11
|
+
|
|
12
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-date-clone.md
|
|
13
|
+
'unicorn/consistent-date-clone': 'error',
|
|
14
|
+
|
|
15
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-destructuring.md
|
|
16
|
+
'unicorn/consistent-destructuring': 'off',
|
|
17
|
+
|
|
18
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-empty-array-spread.md
|
|
19
|
+
'unicorn/consistent-empty-array-spread': 'error',
|
|
20
|
+
|
|
21
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-existence-index-check.md
|
|
22
|
+
'unicorn/consistent-existence-index-check': 'off',
|
|
23
|
+
|
|
24
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
|
|
25
|
+
'unicorn/consistent-function-scoping': 'error',
|
|
26
|
+
|
|
27
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md
|
|
28
|
+
'unicorn/custom-error-definition': 'error',
|
|
29
|
+
|
|
30
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md
|
|
31
|
+
'unicorn/empty-brace-spaces': 'off', // conflicts with prettier
|
|
32
|
+
|
|
33
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
|
|
34
|
+
'unicorn/error-message': 'error',
|
|
35
|
+
|
|
36
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
|
|
37
|
+
'unicorn/escape-case': 'error',
|
|
38
|
+
|
|
39
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/expiring-todo-comments.md
|
|
40
|
+
'unicorn/expiring-todo-comments': 'off',
|
|
41
|
+
|
|
42
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md
|
|
43
|
+
'unicorn/explicit-length-check': 'off',
|
|
44
|
+
|
|
45
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
|
|
46
|
+
'unicorn/filename-case': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
cases: {
|
|
50
|
+
camelCase: true,
|
|
51
|
+
pascalCase: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
|
|
56
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-style.md
|
|
57
|
+
'unicorn/import-style': 'off',
|
|
58
|
+
|
|
59
|
+
// TODO: new rule, enable once released
|
|
60
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/isolated-functions.md
|
|
61
|
+
// 'unicorn/isolated-functions': 'error',
|
|
62
|
+
|
|
63
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
|
|
64
|
+
'unicorn/new-for-builtins': 'error',
|
|
65
|
+
|
|
66
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md
|
|
67
|
+
'unicorn/no-abusive-eslint-disable': 'error',
|
|
68
|
+
|
|
69
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-accessor-recursion.md
|
|
70
|
+
'unicorn/no-accessor-recursion': 'error',
|
|
71
|
+
|
|
72
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-anonymous-default-export.md
|
|
73
|
+
'unicorn/no-anonymous-default-export': 'error',
|
|
74
|
+
|
|
75
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md
|
|
76
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
77
|
+
|
|
78
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
|
|
79
|
+
'unicorn/no-array-for-each': 'off',
|
|
80
|
+
|
|
81
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md
|
|
82
|
+
'unicorn/no-array-method-this-argument': 'error',
|
|
83
|
+
|
|
84
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
|
|
85
|
+
'unicorn/no-array-reduce': 'off',
|
|
86
|
+
|
|
87
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reverse.md
|
|
88
|
+
'unicorn/no-array-reverse': 'warn',
|
|
89
|
+
|
|
90
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-sort.md
|
|
91
|
+
'unicorn/no-array-sort': 'warn',
|
|
92
|
+
|
|
93
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-expression-member.md
|
|
94
|
+
'unicorn/no-await-expression-member': 'error',
|
|
95
|
+
|
|
96
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-in-promise-methods.md
|
|
97
|
+
'unicorn/no-await-in-promise-methods': 'error',
|
|
98
|
+
|
|
99
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-console-spaces.md
|
|
100
|
+
'unicorn/no-console-spaces': 'error',
|
|
101
|
+
|
|
102
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-document-cookie.md
|
|
103
|
+
'unicorn/no-document-cookie': 'error',
|
|
104
|
+
|
|
105
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md
|
|
106
|
+
'unicorn/no-empty-file': 'error',
|
|
107
|
+
|
|
108
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
|
|
109
|
+
'unicorn/no-for-loop': 'error',
|
|
110
|
+
|
|
111
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-hex-escape.md
|
|
112
|
+
'unicorn/no-hex-escape': 'error',
|
|
113
|
+
|
|
114
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-immediate-mutation.md
|
|
115
|
+
'unicorn/no-immediate-mutation': 'error',
|
|
116
|
+
|
|
117
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-builtins.md
|
|
118
|
+
'unicorn/no-instanceof-builtins': 'error',
|
|
119
|
+
|
|
120
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-fetch-options.md
|
|
121
|
+
'unicorn/no-invalid-fetch-options': 'error',
|
|
122
|
+
|
|
123
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
|
|
124
|
+
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
125
|
+
|
|
126
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-keyword-prefix.md
|
|
127
|
+
'unicorn/no-keyword-prefix': 'off',
|
|
128
|
+
|
|
129
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md
|
|
130
|
+
'unicorn/no-lonely-if': 'error',
|
|
131
|
+
|
|
132
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-magic-array-flat-depth.md
|
|
133
|
+
'unicorn/no-magic-array-flat-depth': 'warn',
|
|
134
|
+
|
|
135
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-named-default.md
|
|
136
|
+
'unicorn/no-named-default': 'error',
|
|
137
|
+
|
|
138
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
|
|
139
|
+
'unicorn/no-negated-condition': 'off',
|
|
140
|
+
|
|
141
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negation-in-equality-check.md
|
|
142
|
+
'unicorn/no-negation-in-equality-check': 'error',
|
|
143
|
+
|
|
144
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md
|
|
145
|
+
'unicorn/no-nested-ternary': 'off', // prefer the base rule
|
|
146
|
+
|
|
147
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
|
|
148
|
+
'unicorn/no-new-array': 'error',
|
|
149
|
+
|
|
150
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
|
|
151
|
+
'unicorn/no-new-buffer': 'error',
|
|
152
|
+
|
|
153
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-null.md
|
|
154
|
+
'unicorn/no-null': 'off',
|
|
155
|
+
|
|
156
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-object-as-default-parameter.md
|
|
157
|
+
'unicorn/no-object-as-default-parameter': 'error',
|
|
158
|
+
|
|
159
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
|
|
160
|
+
'unicorn/no-process-exit': 'off',
|
|
161
|
+
|
|
162
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-single-promise-in-promise-methods.md
|
|
163
|
+
'unicorn/no-single-promise-in-promise-methods': 'error',
|
|
164
|
+
|
|
165
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-static-only-class.md
|
|
166
|
+
'unicorn/no-static-only-class': 'error',
|
|
167
|
+
|
|
168
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-thenable.md
|
|
169
|
+
'unicorn/no-thenable': 'error',
|
|
170
|
+
|
|
171
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-assignment.md
|
|
172
|
+
'unicorn/no-this-assignment': 'error',
|
|
173
|
+
|
|
174
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md
|
|
175
|
+
'unicorn/no-typeof-undefined': 'error',
|
|
176
|
+
|
|
177
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-array-flat-depth.md
|
|
178
|
+
'unicorn/no-unnecessary-array-flat-depth': 'error',
|
|
179
|
+
|
|
180
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-array-splice-count.md
|
|
181
|
+
'unicorn/no-unnecessary-array-splice-count': 'error',
|
|
182
|
+
|
|
183
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md
|
|
184
|
+
'unicorn/no-unnecessary-await': 'error',
|
|
185
|
+
|
|
186
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-polyfills.md
|
|
187
|
+
'unicorn/no-unnecessary-polyfills': 'error',
|
|
188
|
+
|
|
189
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-slice-end.md
|
|
190
|
+
'unicorn/no-unnecessary-slice-end': 'error',
|
|
191
|
+
|
|
192
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-array-destructuring.md
|
|
193
|
+
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
194
|
+
|
|
195
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
|
|
196
|
+
'unicorn/no-unreadable-iife': 'error',
|
|
197
|
+
|
|
198
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md
|
|
199
|
+
'unicorn/no-unused-properties': 'warn',
|
|
200
|
+
|
|
201
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-collection-argument.md
|
|
202
|
+
'unicorn/no-useless-collection-argument': 'error',
|
|
203
|
+
|
|
204
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-error-capture-stack-trace.md
|
|
205
|
+
'unicorn/no-useless-error-capture-stack-trace': 'error',
|
|
206
|
+
|
|
207
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-fallback-in-spread.md
|
|
208
|
+
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
209
|
+
|
|
210
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md
|
|
211
|
+
'unicorn/no-useless-length-check': 'error',
|
|
212
|
+
|
|
213
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
|
|
214
|
+
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
215
|
+
|
|
216
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md
|
|
217
|
+
'unicorn/no-useless-spread': 'error',
|
|
218
|
+
|
|
219
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md
|
|
220
|
+
'unicorn/no-useless-switch-case': 'error',
|
|
221
|
+
|
|
222
|
+
// this conflicts with requiring default props in React
|
|
223
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md
|
|
224
|
+
'unicorn/no-useless-undefined': 'off',
|
|
225
|
+
|
|
226
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md
|
|
227
|
+
'unicorn/no-zero-fractions': 'error',
|
|
228
|
+
|
|
229
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
|
|
230
|
+
'unicorn/number-literal-case': 'off', // conflicts with prettier
|
|
231
|
+
|
|
232
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
|
|
233
|
+
'unicorn/numeric-separators-style': 'warn',
|
|
234
|
+
|
|
235
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
|
|
236
|
+
'unicorn/prefer-add-event-listener': 'error',
|
|
237
|
+
|
|
238
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-find.md
|
|
239
|
+
'unicorn/prefer-array-find': 'warn',
|
|
240
|
+
|
|
241
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat.md
|
|
242
|
+
'unicorn/prefer-array-flat': 'warn',
|
|
243
|
+
|
|
244
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md
|
|
245
|
+
'unicorn/prefer-array-flat-map': 'warn',
|
|
246
|
+
|
|
247
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
|
|
248
|
+
'unicorn/prefer-array-index-of': 'warn',
|
|
249
|
+
|
|
250
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-some.md
|
|
251
|
+
'unicorn/prefer-array-some': 'warn',
|
|
252
|
+
|
|
253
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md
|
|
254
|
+
'unicorn/prefer-at': 'error',
|
|
255
|
+
|
|
256
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-bigint-literals.md
|
|
257
|
+
'unicorn/prefer-bigint-literals': 'error',
|
|
258
|
+
|
|
259
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
|
|
260
|
+
'unicorn/prefer-blob-reading-methods': 'error',
|
|
261
|
+
|
|
262
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-class-fields.md
|
|
263
|
+
'unicorn/prefer-class-fields': 'error',
|
|
264
|
+
|
|
265
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-classlist-toggle.md
|
|
266
|
+
'unicorn/prefer-classlist-toggle': 'error',
|
|
267
|
+
|
|
268
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-code-point.md
|
|
269
|
+
'unicorn/prefer-code-point': 'error',
|
|
270
|
+
|
|
271
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-date-now.md
|
|
272
|
+
'unicorn/prefer-date-now': 'error',
|
|
273
|
+
|
|
274
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md
|
|
275
|
+
'unicorn/prefer-default-parameters': 'error',
|
|
276
|
+
|
|
277
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-append.md
|
|
278
|
+
'unicorn/prefer-dom-node-append': 'warn',
|
|
279
|
+
|
|
280
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md
|
|
281
|
+
'unicorn/prefer-dom-node-dataset': 'warn',
|
|
282
|
+
|
|
283
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-remove.md
|
|
284
|
+
'unicorn/prefer-dom-node-remove': 'warn',
|
|
285
|
+
|
|
286
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
|
|
287
|
+
'unicorn/prefer-dom-node-text-content': 'warn',
|
|
288
|
+
|
|
289
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-event-target.md
|
|
290
|
+
'unicorn/prefer-event-target': 'warn',
|
|
291
|
+
|
|
292
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md
|
|
293
|
+
'unicorn/prefer-export-from': 'off',
|
|
294
|
+
|
|
295
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md
|
|
296
|
+
'unicorn/prefer-global-this': 'off',
|
|
297
|
+
|
|
298
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-import-meta-properties.md
|
|
299
|
+
'unicorn/prefer-import-meta-properties': 'off',
|
|
300
|
+
|
|
301
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md
|
|
302
|
+
'unicorn/prefer-includes': 'warn',
|
|
303
|
+
|
|
304
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md
|
|
305
|
+
'unicorn/prefer-json-parse-buffer': 'off',
|
|
306
|
+
|
|
307
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md
|
|
308
|
+
'unicorn/prefer-keyboard-event-key': 'error',
|
|
309
|
+
|
|
310
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
|
|
311
|
+
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
312
|
+
|
|
313
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-min-max.md
|
|
314
|
+
'unicorn/prefer-math-min-max': 'error',
|
|
315
|
+
|
|
316
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md
|
|
317
|
+
'unicorn/prefer-math-trunc': 'off',
|
|
318
|
+
|
|
319
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md
|
|
320
|
+
'unicorn/prefer-modern-dom-apis': 'warn',
|
|
321
|
+
|
|
322
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
|
|
323
|
+
'unicorn/prefer-modern-math-apis': 'error',
|
|
324
|
+
|
|
325
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md
|
|
326
|
+
'unicorn/prefer-module': 'error',
|
|
327
|
+
|
|
328
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md
|
|
329
|
+
'unicorn/prefer-native-coercion-functions': 'error',
|
|
330
|
+
|
|
331
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
|
|
332
|
+
'unicorn/prefer-negative-index': 'off',
|
|
333
|
+
|
|
334
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
335
|
+
'unicorn/prefer-node-protocol': 'warn',
|
|
336
|
+
|
|
337
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
|
|
338
|
+
'unicorn/prefer-number-properties': 'error',
|
|
339
|
+
|
|
340
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-from-entries.md
|
|
341
|
+
'unicorn/prefer-object-from-entries': 'error',
|
|
342
|
+
|
|
343
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
|
|
344
|
+
'unicorn/prefer-optional-catch-binding': 'off',
|
|
345
|
+
|
|
346
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-prototype-methods.md
|
|
347
|
+
'unicorn/prefer-prototype-methods': 'error',
|
|
348
|
+
|
|
349
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md
|
|
350
|
+
'unicorn/prefer-query-selector': 'warn',
|
|
351
|
+
|
|
352
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-reflect-apply.md
|
|
353
|
+
'unicorn/prefer-reflect-apply': 'error',
|
|
354
|
+
|
|
355
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md
|
|
356
|
+
'unicorn/prefer-regexp-test': 'error',
|
|
357
|
+
|
|
358
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-response-static-json.md
|
|
359
|
+
'unicorn/prefer-response-static-json': 'error',
|
|
360
|
+
|
|
361
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md
|
|
362
|
+
'unicorn/prefer-set-has': 'off',
|
|
363
|
+
|
|
364
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md
|
|
365
|
+
'unicorn/prefer-set-size': 'error',
|
|
366
|
+
|
|
367
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-call.md
|
|
368
|
+
'unicorn/prefer-single-call': 'error',
|
|
369
|
+
|
|
370
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
|
|
371
|
+
'unicorn/prefer-spread': 'error',
|
|
372
|
+
|
|
373
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-raw.md
|
|
374
|
+
'unicorn/prefer-string-raw': 'off',
|
|
375
|
+
|
|
376
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
|
|
377
|
+
'unicorn/prefer-string-replace-all': 'off',
|
|
378
|
+
|
|
379
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
|
|
380
|
+
'unicorn/prefer-string-slice': 'error',
|
|
381
|
+
|
|
382
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md
|
|
383
|
+
'unicorn/prefer-string-starts-ends-with': 'warn',
|
|
384
|
+
|
|
385
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-trim-start-end.md
|
|
386
|
+
'unicorn/prefer-string-trim-start-end': 'error',
|
|
387
|
+
|
|
388
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-structured-clone.md
|
|
389
|
+
'unicorn/prefer-structured-clone': 'error',
|
|
390
|
+
|
|
391
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md
|
|
392
|
+
'unicorn/prefer-switch': 'off',
|
|
393
|
+
|
|
394
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md
|
|
395
|
+
'unicorn/prefer-ternary': 'error',
|
|
396
|
+
|
|
397
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-top-level-await.md
|
|
398
|
+
'unicorn/prefer-top-level-await': 'error',
|
|
399
|
+
|
|
400
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
|
|
401
|
+
'unicorn/prefer-type-error': 'error',
|
|
402
|
+
|
|
403
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
|
|
404
|
+
'unicorn/prevent-abbreviations': 'off',
|
|
405
|
+
|
|
406
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/relative-url-style.md
|
|
407
|
+
'unicorn/relative-url-style': ['error', 'always'],
|
|
408
|
+
|
|
409
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md
|
|
410
|
+
'unicorn/require-array-join-separator': 'error',
|
|
411
|
+
|
|
412
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-module-attributes.md
|
|
413
|
+
'unicorn/require-module-attributes': 'error',
|
|
414
|
+
|
|
415
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-module-specifiers.md
|
|
416
|
+
'unicorn/require-module-specifiers': 'error',
|
|
417
|
+
|
|
418
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md
|
|
419
|
+
'unicorn/require-number-to-fixed-digits-argument': 'error',
|
|
420
|
+
|
|
421
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-post-message-target-origin.md
|
|
422
|
+
'unicorn/require-post-message-target-origin': 'off',
|
|
423
|
+
|
|
424
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/string-content.md
|
|
425
|
+
'unicorn/string-content': 'off',
|
|
426
|
+
|
|
427
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md
|
|
428
|
+
'unicorn/switch-case-braces': 'off', // no-empty already takes care of this
|
|
429
|
+
|
|
430
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/template-indent.md
|
|
431
|
+
'unicorn/template-indent': 'off', // conflicts with prettier
|
|
432
|
+
|
|
433
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md
|
|
434
|
+
'unicorn/text-encoding-identifier-case': 'error',
|
|
435
|
+
|
|
436
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
|
|
437
|
+
'unicorn/throw-new-error': 'error', // handled by unicorn/new-for-builtins
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
export default getUnicornPluginRules;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Combined JavaScript, JSX, TypeScript, and TSX extensions */
|
|
2
|
+
declare const allExtensions: string[];
|
|
3
|
+
/** String version of allExtensions for use in glob patterns */
|
|
4
|
+
declare const allExtensionsString: string;
|
|
5
|
+
|
|
6
|
+
/** Node.js extensions (JavaScript and TypeScript) */
|
|
7
|
+
declare const nodeExtensions: string[];
|
|
8
|
+
/** String version of nodeExtensions for use in glob patterns */
|
|
9
|
+
declare const nodeExtensionsString: string;
|
|
10
|
+
|
|
11
|
+
/** React JavaScript extensions only */
|
|
12
|
+
declare const reactJsExtensions: string[];
|
|
13
|
+
/** String version of reactJsExtensions for use in glob patterns */
|
|
14
|
+
declare const reactJsExtensionsString: string;
|
|
15
|
+
|
|
16
|
+
/** React extensions (JSX and TSX) */
|
|
17
|
+
declare const reactExtensions: string[];
|
|
18
|
+
/** String version of reactExtensions for use in glob patterns */
|
|
19
|
+
declare const reactExtensionsString: string;
|
|
20
|
+
|
|
21
|
+
/** Extended React JavaScript extensions (includes .js and .jsx) */
|
|
22
|
+
declare const reactJsExtensionsExtended: string[];
|
|
23
|
+
/** String version of reactJsExtensionsExtended for use in glob patterns */
|
|
24
|
+
declare const reactJsExtensionsExtendedString: string;
|
|
25
|
+
|
|
26
|
+
/** Extended React extensions (includes .js, .jsx, and .tsx) */
|
|
27
|
+
declare const reactExtensionsExtended: string[];
|
|
28
|
+
/** String version of reactExtensionsExtended for use in glob patterns */
|
|
29
|
+
declare const reactExtensionsExtendedString: string;
|
|
30
|
+
|
|
31
|
+
/** TypeScript extensions (includes .ts and .tsx) */
|
|
32
|
+
declare const typescriptExtensions: string[];
|
|
33
|
+
/** String version of typescriptExtensions for use in glob patterns */
|
|
34
|
+
declare const typescriptExtensionsString: string;
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
allExtensions,
|
|
38
|
+
allExtensionsString,
|
|
39
|
+
nodeExtensions,
|
|
40
|
+
nodeExtensionsString,
|
|
41
|
+
reactJsExtensions,
|
|
42
|
+
reactJsExtensionsString,
|
|
43
|
+
reactJsExtensionsExtended,
|
|
44
|
+
reactJsExtensionsExtendedString,
|
|
45
|
+
reactExtensions,
|
|
46
|
+
reactExtensionsString,
|
|
47
|
+
reactExtensionsExtended,
|
|
48
|
+
reactExtensionsExtendedString,
|
|
49
|
+
typescriptExtensions,
|
|
50
|
+
typescriptExtensionsString,
|
|
51
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Base extension groups
|
|
2
|
+
const jsExtensions = ['.js', '.mjs', '.cjs'];
|
|
3
|
+
const jsxExtensions = ['.jsx', '.mjsx', '.cjsx'];
|
|
4
|
+
const tsExtensions = ['.ts', '.cts', '.mts'];
|
|
5
|
+
const tsxExtensions = ['.tsx', '.mtsx', '.ctsx'];
|
|
6
|
+
|
|
7
|
+
// Combined extension arrays
|
|
8
|
+
const allExtensions = [
|
|
9
|
+
...jsExtensions,
|
|
10
|
+
...jsxExtensions,
|
|
11
|
+
...tsExtensions,
|
|
12
|
+
...tsxExtensions,
|
|
13
|
+
];
|
|
14
|
+
const nodeExtensions = [...jsExtensions, ...tsExtensions];
|
|
15
|
+
const reactJsExtensions = jsxExtensions;
|
|
16
|
+
const reactExtensions = [...jsxExtensions, ...tsxExtensions];
|
|
17
|
+
const reactJsExtensionsExtended = [...jsExtensions, ...jsxExtensions];
|
|
18
|
+
const reactExtensionsExtended = [
|
|
19
|
+
...jsExtensions,
|
|
20
|
+
...jsxExtensions,
|
|
21
|
+
...tsxExtensions,
|
|
22
|
+
];
|
|
23
|
+
const typescriptExtensions = [...tsExtensions, ...tsxExtensions];
|
|
24
|
+
|
|
25
|
+
// String versions for use in glob patterns
|
|
26
|
+
const allExtensionsString = allExtensions.join(',');
|
|
27
|
+
const nodeExtensionsString = nodeExtensions.join(',');
|
|
28
|
+
const reactJsExtensionsString = reactJsExtensions.join(',');
|
|
29
|
+
const reactExtensionsString = reactExtensions.join(',');
|
|
30
|
+
const reactJsExtensionsExtendedString = reactJsExtensionsExtended.join(',');
|
|
31
|
+
const reactExtensionsExtendedString = reactExtensionsExtended.join(',');
|
|
32
|
+
const typescriptExtensionsString = typescriptExtensions.join(',');
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
allExtensions,
|
|
36
|
+
allExtensionsString,
|
|
37
|
+
nodeExtensions,
|
|
38
|
+
nodeExtensionsString,
|
|
39
|
+
reactJsExtensions,
|
|
40
|
+
reactJsExtensionsString,
|
|
41
|
+
reactJsExtensionsExtended,
|
|
42
|
+
reactJsExtensionsExtendedString,
|
|
43
|
+
reactExtensions,
|
|
44
|
+
reactExtensionsString,
|
|
45
|
+
reactExtensionsExtended,
|
|
46
|
+
reactExtensionsExtendedString,
|
|
47
|
+
typescriptExtensions,
|
|
48
|
+
typescriptExtensionsString,
|
|
49
|
+
};
|
package/src/prettier.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
useTabs: true,
|
|
3
|
+
tabWidth: 4,
|
|
4
|
+
semi: true,
|
|
5
|
+
singleQuote: true,
|
|
6
|
+
trailingComma: 'es5',
|
|
7
|
+
// override trailingComma for jsonc and eslintrc files https://github.com/prettier/prettier/issues/15956
|
|
8
|
+
overrides: [
|
|
9
|
+
{
|
|
10
|
+
files: ['**/*.jsonc', '**/*.eslintrc'],
|
|
11
|
+
options: {
|
|
12
|
+
trailingComma: 'none',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
/* Language and Environment */
|
|
5
|
+
"target": "ES2022", // output code
|
|
6
|
+
"lib": ["ES2022"], // input code - Node.js ES support
|
|
7
|
+
|
|
8
|
+
/* Modules */
|
|
9
|
+
"module": "NodeNext", // Node.js native ESM
|
|
10
|
+
"moduleResolution": "NodeNext", // Node.js native ESM resolution
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
|
|
13
|
+
/* Emit */
|
|
14
|
+
"outDir": "./dist",
|
|
15
|
+
"noEmit": true, // using external tools for compilation
|
|
16
|
+
"incremental": true, // cache type checking results
|
|
17
|
+
|
|
18
|
+
/* Interop Constraints */
|
|
19
|
+
"esModuleInterop": true, // CommonJS/ESM interop
|
|
20
|
+
"allowSyntheticDefaultImports": true, // allows default imports from modules with no default export
|
|
21
|
+
"isolatedModules": true, // ensures each file can be independently transpiled
|
|
22
|
+
|
|
23
|
+
/* Type Checking */
|
|
24
|
+
"strict": true, // includes several rules it enables
|
|
25
|
+
"noUnusedLocals": false, // using @typescript-eslint/no-unused-vars instead
|
|
26
|
+
"noUnusedParameters": false, // using @typescript-eslint/no-unused-vars instead
|
|
27
|
+
"noFallthroughCasesInSwitch": true,
|
|
28
|
+
"skipLibCheck": true, // skip dependency type checking (standard to set as true)
|
|
29
|
+
"noUncheckedIndexedAccess": true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./tsconfig.base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
/* Language and Environment */
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"], // browser APIs
|
|
7
|
+
"jsx": "react-jsx", // React 17+ jsx transform (automatic runtime / no React import)
|
|
8
|
+
|
|
9
|
+
/* Modules */
|
|
10
|
+
"module": "ESNext", // needed since webpack/babel is handling compilation
|
|
11
|
+
"moduleResolution": "bundler" // needed since webpack/babel is handling compilation
|
|
12
|
+
}
|
|
13
|
+
}
|