@eslint-react/eslint-plugin 1.48.4-next.0 → 2.0.0-next.1

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/dist/index.mjs DELETED
@@ -1,460 +0,0 @@
1
- import reactDebug from 'eslint-plugin-react-debug';
2
- import reactDom from 'eslint-plugin-react-dom';
3
- import reactHooksExtra from 'eslint-plugin-react-hooks-extra';
4
- import reactNamingConvention from 'eslint-plugin-react-naming-convention';
5
- import reactWebApi from 'eslint-plugin-react-web-api';
6
- import react from 'eslint-plugin-react-x';
7
- import { DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
8
-
9
- var __defProp = Object.defineProperty;
10
- var __export = (target, all) => {
11
- for (var name14 in all)
12
- __defProp(target, name14, { get: all[name14], enumerable: true });
13
- };
14
-
15
- // package.json
16
- var name = "@eslint-react/eslint-plugin";
17
- var version = "1.48.4-next.0";
18
-
19
- // src/configs/all.ts
20
- var all_exports = {};
21
- __export(all_exports, {
22
- name: () => name4,
23
- plugins: () => plugins3,
24
- rules: () => rules3,
25
- settings: () => settings3
26
- });
27
-
28
- // src/configs/dom.ts
29
- var dom_exports = {};
30
- __export(dom_exports, {
31
- name: () => name2,
32
- plugins: () => plugins,
33
- rules: () => rules,
34
- settings: () => settings
35
- });
36
- var name2 = "@eslint-react/dom";
37
- var rules = {
38
- "@eslint-react/dom/no-dangerously-set-innerhtml": "warn",
39
- "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
40
- "@eslint-react/dom/no-find-dom-node": "error",
41
- "@eslint-react/dom/no-flush-sync": "error",
42
- "@eslint-react/dom/no-hydrate": "error",
43
- "@eslint-react/dom/no-missing-button-type": "warn",
44
- "@eslint-react/dom/no-missing-iframe-sandbox": "warn",
45
- "@eslint-react/dom/no-namespace": "error",
46
- "@eslint-react/dom/no-render": "error",
47
- "@eslint-react/dom/no-render-return-value": "error",
48
- "@eslint-react/dom/no-script-url": "warn",
49
- "@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
50
- "@eslint-react/dom/no-unsafe-target-blank": "warn",
51
- "@eslint-react/dom/no-use-form-state": "error",
52
- "@eslint-react/dom/no-void-elements-with-children": "error"
53
- };
54
- var plugins = {
55
- "@eslint-react/dom": reactDom
56
- };
57
- var settings = {
58
- "react-x": DEFAULT_ESLINT_REACT_SETTINGS
59
- };
60
-
61
- // src/configs/x.ts
62
- var x_exports = {};
63
- __export(x_exports, {
64
- name: () => name3,
65
- plugins: () => plugins2,
66
- rules: () => rules2,
67
- settings: () => settings2
68
- });
69
- var name3 = "@eslint-react/x";
70
- var rules2 = {
71
- "@eslint-react/jsx-no-duplicate-props": "warn",
72
- "@eslint-react/jsx-uses-react": "warn",
73
- "@eslint-react/jsx-uses-vars": "warn",
74
- "@eslint-react/no-access-state-in-setstate": "error",
75
- "@eslint-react/no-array-index-key": "warn",
76
- "@eslint-react/no-children-count": "warn",
77
- "@eslint-react/no-children-for-each": "warn",
78
- "@eslint-react/no-children-map": "warn",
79
- "@eslint-react/no-children-only": "warn",
80
- "@eslint-react/no-children-to-array": "warn",
81
- "@eslint-react/no-clone-element": "warn",
82
- "@eslint-react/no-comment-textnodes": "warn",
83
- "@eslint-react/no-component-will-mount": "error",
84
- "@eslint-react/no-component-will-receive-props": "error",
85
- "@eslint-react/no-component-will-update": "error",
86
- "@eslint-react/no-context-provider": "warn",
87
- "@eslint-react/no-create-ref": "error",
88
- "@eslint-react/no-default-props": "error",
89
- "@eslint-react/no-direct-mutation-state": "error",
90
- "@eslint-react/no-duplicate-key": "warn",
91
- "@eslint-react/no-forward-ref": "warn",
92
- "@eslint-react/no-implicit-key": "warn",
93
- "@eslint-react/no-missing-key": "error",
94
- "@eslint-react/no-misused-capture-owner-stack": "error",
95
- "@eslint-react/no-nested-component-definitions": "error",
96
- "@eslint-react/no-nested-lazy-component-declarations": "warn",
97
- "@eslint-react/no-prop-types": "error",
98
- "@eslint-react/no-redundant-should-component-update": "error",
99
- "@eslint-react/no-set-state-in-component-did-mount": "warn",
100
- "@eslint-react/no-set-state-in-component-did-update": "warn",
101
- "@eslint-react/no-set-state-in-component-will-update": "warn",
102
- "@eslint-react/no-string-refs": "error",
103
- "@eslint-react/no-unsafe-component-will-mount": "warn",
104
- "@eslint-react/no-unsafe-component-will-receive-props": "warn",
105
- "@eslint-react/no-unsafe-component-will-update": "warn",
106
- "@eslint-react/no-unstable-context-value": "warn",
107
- "@eslint-react/no-unstable-default-props": "warn",
108
- "@eslint-react/no-unused-class-component-members": "warn",
109
- "@eslint-react/no-unused-state": "warn",
110
- "@eslint-react/no-use-context": "warn",
111
- "@eslint-react/no-useless-forward-ref": "warn"
112
- };
113
- var plugins2 = {
114
- "@eslint-react": react
115
- };
116
- var settings2 = {
117
- "react-x": DEFAULT_ESLINT_REACT_SETTINGS
118
- };
119
-
120
- // src/configs/all.ts
121
- var name4 = "@eslint-react/all";
122
- var rules3 = {
123
- "@eslint-react/avoid-shorthand-boolean": "warn",
124
- "@eslint-react/avoid-shorthand-fragment": "warn",
125
- "@eslint-react/jsx-no-duplicate-props": "warn",
126
- "@eslint-react/jsx-no-undef": "error",
127
- "@eslint-react/jsx-uses-react": "warn",
128
- "@eslint-react/jsx-uses-vars": "warn",
129
- "@eslint-react/no-access-state-in-setstate": "error",
130
- "@eslint-react/no-array-index-key": "warn",
131
- "@eslint-react/no-children-count": "warn",
132
- "@eslint-react/no-children-for-each": "warn",
133
- "@eslint-react/no-children-map": "warn",
134
- "@eslint-react/no-children-only": "warn",
135
- "@eslint-react/no-children-prop": "warn",
136
- "@eslint-react/no-children-to-array": "warn",
137
- "@eslint-react/no-class-component": "warn",
138
- "@eslint-react/no-clone-element": "warn",
139
- "@eslint-react/no-comment-textnodes": "warn",
140
- "@eslint-react/no-complex-conditional-rendering": "warn",
141
- "@eslint-react/no-component-will-mount": "error",
142
- "@eslint-react/no-component-will-receive-props": "error",
143
- "@eslint-react/no-component-will-update": "error",
144
- "@eslint-react/no-context-provider": "warn",
145
- "@eslint-react/no-create-ref": "error",
146
- "@eslint-react/no-default-props": "error",
147
- "@eslint-react/no-direct-mutation-state": "error",
148
- "@eslint-react/no-duplicate-key": "warn",
149
- "@eslint-react/no-forward-ref": "warn",
150
- "@eslint-react/no-implicit-key": "warn",
151
- // "@eslint-react/no-leaked-conditional-rendering": "warn",
152
- "@eslint-react/no-missing-component-display-name": "warn",
153
- "@eslint-react/no-missing-context-display-name": "warn",
154
- "@eslint-react/no-missing-key": "error",
155
- "@eslint-react/no-misused-capture-owner-stack": "error",
156
- "@eslint-react/no-nested-component-definitions": "error",
157
- "@eslint-react/no-nested-lazy-component-declarations": "warn",
158
- "@eslint-react/no-prop-types": "error",
159
- "@eslint-react/no-redundant-should-component-update": "error",
160
- "@eslint-react/no-set-state-in-component-did-mount": "warn",
161
- "@eslint-react/no-set-state-in-component-did-update": "warn",
162
- "@eslint-react/no-set-state-in-component-will-update": "warn",
163
- "@eslint-react/no-string-refs": "error",
164
- "@eslint-react/no-unsafe-component-will-mount": "warn",
165
- "@eslint-react/no-unsafe-component-will-receive-props": "warn",
166
- "@eslint-react/no-unsafe-component-will-update": "warn",
167
- "@eslint-react/no-unstable-context-value": "warn",
168
- "@eslint-react/no-unstable-default-props": "warn",
169
- "@eslint-react/no-unused-class-component-members": "warn",
170
- "@eslint-react/no-unused-state": "warn",
171
- "@eslint-react/no-use-context": "warn",
172
- "@eslint-react/no-useless-forward-ref": "warn",
173
- "@eslint-react/no-useless-fragment": "warn",
174
- "@eslint-react/prefer-destructuring-assignment": "warn",
175
- "@eslint-react/prefer-react-namespace-import": "warn",
176
- // "@eslint-react/prefer-read-only-props": "warn",
177
- "@eslint-react/prefer-shorthand-boolean": "off",
178
- "@eslint-react/prefer-shorthand-fragment": "off",
179
- "@eslint-react/dom/no-dangerously-set-innerhtml": "warn",
180
- "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
181
- "@eslint-react/dom/no-find-dom-node": "error",
182
- "@eslint-react/dom/no-flush-sync": "error",
183
- "@eslint-react/dom/no-hydrate": "error",
184
- "@eslint-react/dom/no-missing-button-type": "warn",
185
- "@eslint-react/dom/no-missing-iframe-sandbox": "warn",
186
- "@eslint-react/dom/no-namespace": "error",
187
- "@eslint-react/dom/no-render": "error",
188
- "@eslint-react/dom/no-render-return-value": "error",
189
- "@eslint-react/dom/no-script-url": "warn",
190
- "@eslint-react/dom/no-unknown-property": "warn",
191
- "@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
192
- "@eslint-react/dom/no-unsafe-target-blank": "warn",
193
- "@eslint-react/dom/no-use-form-state": "error",
194
- "@eslint-react/dom/no-void-elements-with-children": "error",
195
- "@eslint-react/web-api/no-leaked-event-listener": "warn",
196
- "@eslint-react/web-api/no-leaked-interval": "warn",
197
- "@eslint-react/web-api/no-leaked-resize-observer": "warn",
198
- "@eslint-react/web-api/no-leaked-timeout": "warn",
199
- "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
200
- "@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": "warn",
201
- "@eslint-react/hooks-extra/no-unnecessary-use-callback": "warn",
202
- "@eslint-react/hooks-extra/no-unnecessary-use-memo": "warn",
203
- "@eslint-react/hooks-extra/no-unnecessary-use-prefix": "warn",
204
- "@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
205
- "@eslint-react/naming-convention/component-name": "warn",
206
- "@eslint-react/naming-convention/context-name": "warn",
207
- "@eslint-react/naming-convention/filename": "warn",
208
- "@eslint-react/naming-convention/filename-extension": "warn",
209
- "@eslint-react/naming-convention/use-state": "warn"
210
- };
211
- var plugins3 = {
212
- ...plugins2,
213
- ...plugins,
214
- "@eslint-react/debug": reactDebug,
215
- "@eslint-react/hooks-extra": reactHooksExtra,
216
- "@eslint-react/naming-convention": reactNamingConvention,
217
- "@eslint-react/web-api": reactWebApi
218
- };
219
- var settings3 = {
220
- ...settings
221
- };
222
-
223
- // src/configs/debug.ts
224
- var debug_exports = {};
225
- __export(debug_exports, {
226
- name: () => name5,
227
- plugins: () => plugins4,
228
- rules: () => rules4
229
- });
230
- var name5 = "@eslint-react/debug";
231
- var rules4 = {
232
- "@eslint-react/debug/class-component": "warn",
233
- "@eslint-react/debug/function-component": "warn",
234
- "@eslint-react/debug/hook": "warn",
235
- "@eslint-react/debug/is-from-react": "warn",
236
- "@eslint-react/debug/jsx": "warn"
237
- };
238
- var plugins4 = {
239
- "@eslint-react/debug": reactDebug
240
- };
241
-
242
- // src/configs/disable-debug.ts
243
- var disable_debug_exports = {};
244
- __export(disable_debug_exports, {
245
- name: () => name6,
246
- rules: () => rules5
247
- });
248
- var name6 = "@eslint-react/disable-debug";
249
- var rules5 = Object.fromEntries(Object.entries(rules4).map(([rule]) => [rule, "off"]));
250
-
251
- // src/configs/disable-dom.ts
252
- var disable_dom_exports = {};
253
- __export(disable_dom_exports, {
254
- name: () => name7,
255
- rules: () => rules6
256
- });
257
- var name7 = "@eslint-react/disable-dom";
258
- var rules6 = Object.fromEntries(Object.entries(rules).map(([key]) => [key, "off"]));
259
-
260
- // src/configs/disable-type-checked.ts
261
- var disable_type_checked_exports = {};
262
- __export(disable_type_checked_exports, {
263
- name: () => name8,
264
- rules: () => rules7
265
- });
266
- var name8 = "@eslint-react/disable-type-checked";
267
- var rules7 = {
268
- "@eslint-react/no-leaked-conditional-rendering": "off",
269
- "@eslint-react/prefer-read-only-props": "off"
270
- };
271
-
272
- // src/configs/disable-web-api.ts
273
- var disable_web_api_exports = {};
274
- __export(disable_web_api_exports, {
275
- name: () => name9,
276
- rules: () => rules9
277
- });
278
- var rules8 = {
279
- "@eslint-react/web-api/no-leaked-event-listener": "warn",
280
- "@eslint-react/web-api/no-leaked-interval": "warn",
281
- "@eslint-react/web-api/no-leaked-resize-observer": "warn",
282
- "@eslint-react/web-api/no-leaked-timeout": "warn"
283
- };
284
- var plugins5 = {
285
- "@eslint-react/web-api": reactWebApi
286
- };
287
-
288
- // src/configs/disable-web-api.ts
289
- var name9 = "@eslint-react/disable-web-api";
290
- var rules9 = Object.fromEntries(Object.entries(rules8).map(([key]) => [key, "off"]));
291
-
292
- // src/configs/off.ts
293
- var off_exports = {};
294
- __export(off_exports, {
295
- name: () => name10,
296
- rules: () => rules10
297
- });
298
- var name10 = "@eslint-react/off";
299
- var rules10 = {
300
- ...Object.fromEntries(Object.entries(rules3).map(([key]) => [key, "off"])),
301
- ...rules7
302
- };
303
-
304
- // src/configs/recommended.ts
305
- var recommended_exports = {};
306
- __export(recommended_exports, {
307
- name: () => name11,
308
- plugins: () => plugins6,
309
- rules: () => rules11,
310
- settings: () => settings5
311
- });
312
- var name11 = "@eslint-react/recommended";
313
- var rules11 = {
314
- ...rules2,
315
- ...rules,
316
- ...rules8,
317
- "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
318
- "@eslint-react/hooks-extra/no-unnecessary-use-prefix": "warn",
319
- "@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
320
- "@eslint-react/naming-convention/context-name": "warn"
321
- // "@eslint-react/naming-convention/use-state": "warn",
322
- };
323
- var plugins6 = {
324
- ...plugins2,
325
- ...plugins,
326
- ...plugins5,
327
- "@eslint-react/debug": reactDebug,
328
- "@eslint-react/hooks-extra": reactHooksExtra,
329
- "@eslint-react/naming-convention": reactNamingConvention
330
- };
331
- var settings5 = {
332
- ...settings
333
- };
334
-
335
- // src/configs/recommended-type-checked.ts
336
- var recommended_type_checked_exports = {};
337
- __export(recommended_type_checked_exports, {
338
- name: () => name13,
339
- plugins: () => plugins8,
340
- rules: () => rules13,
341
- settings: () => settings7
342
- });
343
-
344
- // src/configs/recommended-typescript.ts
345
- var recommended_typescript_exports = {};
346
- __export(recommended_typescript_exports, {
347
- name: () => name12,
348
- plugins: () => plugins7,
349
- rules: () => rules12,
350
- settings: () => settings6
351
- });
352
- var name12 = "@eslint-react/recommended-typescript";
353
- var rules12 = {
354
- ...rules11,
355
- "@eslint-react/dom/no-unknown-property": "off",
356
- "@eslint-react/jsx-no-duplicate-props": "off",
357
- "@eslint-react/jsx-uses-react": "off",
358
- "@eslint-react/jsx-uses-vars": "off"
359
- };
360
- var plugins7 = {
361
- ...plugins6
362
- };
363
- var settings6 = {
364
- ...settings5
365
- };
366
-
367
- // src/configs/recommended-type-checked.ts
368
- var name13 = "@eslint-react/recommended-type-checked";
369
- var rules13 = {
370
- ...rules12,
371
- "@eslint-react/no-leaked-conditional-rendering": "warn"
372
- // "@eslint-react/prefer-read-only-props": "warn",
373
- };
374
- var plugins8 = {
375
- ...plugins7
376
- };
377
- var settings7 = {
378
- ...settings6
379
- };
380
-
381
- // src/utils/type-of.ts
382
- function typeOf(t) {
383
- return Object.prototype.toString.call(t).replace(/^\[object (.+)\]$/, "$1").toLowerCase();
384
- }
385
-
386
- // src/utils/transform-keys.ts
387
- function transformKeys(obj, transform) {
388
- if (typeOf(obj) !== "object") {
389
- return obj;
390
- }
391
- const res = {};
392
- for (const key in obj) {
393
- res[transform(key)] = obj[key];
394
- }
395
- return res;
396
- }
397
-
398
- // src/utils/pad-keys-left.ts
399
- function padKeysLeft(obj, left) {
400
- return transformKeys(obj, (key) => `${left}${key}`);
401
- }
402
-
403
- // src/index.ts
404
- function toLegacyConfig({ rules: rules14 }) {
405
- return {
406
- plugins: ["@eslint-react"],
407
- rules: rules14
408
- };
409
- }
410
- var index_default = {
411
- meta: {
412
- name,
413
- version
414
- },
415
- configs: {
416
- ["all"]: all_exports,
417
- ["all-legacy"]: toLegacyConfig(all_exports),
418
- ["debug"]: debug_exports,
419
- ["debug-legacy"]: toLegacyConfig(debug_exports),
420
- ["disable-debug"]: disable_debug_exports,
421
- ["disable-debug-legacy"]: toLegacyConfig(disable_debug_exports),
422
- ["disable-dom"]: disable_dom_exports,
423
- ["disable-dom-legacy"]: toLegacyConfig(disable_dom_exports),
424
- ["disable-type-checked"]: disable_type_checked_exports,
425
- ["disable-type-checked-legacy"]: toLegacyConfig(disable_type_checked_exports),
426
- ["disable-web-api"]: disable_web_api_exports,
427
- ["disable-web-api-legacy"]: toLegacyConfig(disable_web_api_exports),
428
- ["dom"]: dom_exports,
429
- ["dom-legacy"]: toLegacyConfig(dom_exports),
430
- ["off"]: off_exports,
431
- ["off-legacy"]: toLegacyConfig(off_exports),
432
- ["recommended"]: recommended_exports,
433
- ["recommended-legacy"]: toLegacyConfig(recommended_exports),
434
- ["recommended-type-checked"]: recommended_type_checked_exports,
435
- ["recommended-type-checked-legacy"]: toLegacyConfig(recommended_type_checked_exports),
436
- ["recommended-typescript"]: recommended_typescript_exports,
437
- ["recommended-typescript-legacy"]: toLegacyConfig(recommended_typescript_exports),
438
- ["x"]: x_exports,
439
- ["x-legacy"]: toLegacyConfig(x_exports),
440
- // Part: deprecated presets
441
- /** @deprecated Use `x` instead */
442
- ["core"]: x_exports,
443
- /** @deprecated Use `x-legacy` instead */
444
- ["core-legacy"]: toLegacyConfig(x_exports),
445
- /** @deprecated Use `disable-dom` instead */
446
- ["off-dom"]: disable_dom_exports,
447
- /** @deprecated Use `disable-dom-legacy` instead */
448
- ["off-dom-legacy"]: toLegacyConfig(disable_dom_exports)
449
- },
450
- rules: {
451
- ...react.rules,
452
- ...padKeysLeft(reactDom.rules, "dom/"),
453
- ...padKeysLeft(reactWebApi.rules, "web-api/"),
454
- ...padKeysLeft(reactHooksExtra.rules, "hooks-extra/"),
455
- ...padKeysLeft(reactNamingConvention.rules, "naming-convention/"),
456
- ...padKeysLeft(reactDebug.rules, "debug/")
457
- }
458
- };
459
-
460
- export { index_default as default };