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