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