@eslint-react/eslint-plugin 3.0.0-rc.5 → 4.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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Version](https://img.shields.io/npm/v/@eslint-react/eslint-plugin?style=flat&colorA=111111&colorB=000000)](https://npmx.dev/package/@eslint-react/eslint-plugin)
6
6
  [![Downloads](https://img.shields.io/npm/dt/@eslint-react/eslint-plugin.svg?style=flat&colorA=222222&colorB=000000)](https://npmx.dev/package/@eslint-react/eslint-plugin)
7
7
  [![License](https://img.shields.io/npm/l/@eslint-react/eslint-plugin?style=flat&colorA=333333&colorB=000000)](https://github.com/Rel1cx/eslint-react/blob/main/LICENSE)
8
- [![Build with](https://img.shields.io/badge/built_with-tsdown@0.21.2-000000?style=flat)](https://tsdown.dev)
8
+ [![Build with](https://img.shields.io/badge/built_with-tsdown@0.21.4-000000?style=flat)](https://tsdown.dev)
9
9
 
10
10
  4-7x faster, composable ESLint rules for React and friends.
11
11
 
@@ -31,6 +31,7 @@
31
31
  - [Changelog](#changelog)
32
32
  - [Roadmap](#roadmap)
33
33
  - [Disclaimer](#disclaimer)
34
+ - [Sponsors](#sponsors)
34
35
  - [Contributing](#contributing)
35
36
  - [License](#license)
36
37
 
@@ -46,6 +47,7 @@
46
47
  ### Modular ESLint Plugins
47
48
 
48
49
  - [`eslint-plugin-react-x`](https://npmx.dev/package/eslint-plugin-react-x) - X rules (renderer-agnostic, compatible with x-platform).
50
+ - [`eslint-plugin-react-jsx`](https://npmx.dev/package/eslint-plugin-react-jsx) - React Flavored JSX rules.
49
51
  - [`eslint-plugin-react-rsc`](https://npmx.dev/package/eslint-plugin-react-rsc) - Rules for React Server Components.
50
52
  - [`eslint-plugin-react-dom`](https://npmx.dev/package/eslint-plugin-react-dom) - DOM-specific rules for React DOM.
51
53
  - [`eslint-plugin-react-web-api`](https://npmx.dev/package/eslint-plugin-react-web-api) - Rules for interacting with Web APIs.
@@ -124,6 +126,8 @@ export default defineConfig(
124
126
 
125
127
  - `x`\
126
128
  Enable rules for React.
129
+ - `jsx`\
130
+ Enable rules for React Flavored JSX.
127
131
  - `rsc`\
128
132
  Enable rules for React Server Components.
129
133
  - `dom`\
@@ -156,6 +160,8 @@ export default defineConfig(
156
160
 
157
161
  ### Other
158
162
 
163
+ - `disable-jsx`\
164
+ Disable rules in the `jsx` preset.
159
165
  - `disable-rsc`\
160
166
  Disable rules in the `rsc` preset.
161
167
  - `disable-dom`\
@@ -201,6 +207,16 @@ This project is not affiliated with Meta Corporation or the [facebook/react](htt
201
207
 
202
208
  This project is, and will remain, 90% of its code written by humans.
203
209
 
210
+ ## Sponsors
211
+
212
+ A huge thank you to our amazing sponsors who make this project possible.
213
+
214
+ <p align="center">
215
+ <a href="##">
216
+ <img src=".github/sponsors.svg" alt="Sponsors" />
217
+ </a>
218
+ </p>
219
+
204
220
  ## Contributing
205
221
 
206
222
  Contributions are welcome!
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ESLint, Linter } from "eslint";
2
2
 
3
3
  //#region src/index.d.ts
4
- type ConfigName = "all" | "disable-conflict-eslint-plugin-react" | "disable-conflict-eslint-plugin-react-hooks" | "disable-dom" | "disable-rsc" | "disable-experimental" | "disable-type-checked" | "disable-web-api" | "dom" | "rsc" | "off" | "recommended" | "recommended-type-checked" | "recommended-typescript" | "strict" | "strict-type-checked" | "strict-typescript" | "web-api" | "x";
5
- declare const plugin: ESLint.Plugin & {
4
+ type ConfigName = "all" | "disable-conflict-eslint-plugin-react" | "disable-conflict-eslint-plugin-react-hooks" | "disable-dom" | "disable-jsx" | "disable-rsc" | "disable-experimental" | "disable-type-checked" | "disable-web-api" | "dom" | "jsx" | "rsc" | "off" | "recommended" | "recommended-type-checked" | "recommended-typescript" | "strict" | "strict-type-checked" | "strict-typescript" | "web-api" | "x";
5
+ declare const finalPlugin: ESLint.Plugin & {
6
6
  /**
7
7
  * For more information about each preset, please refer to the documentation.
8
8
  * @see https://eslint-react.xyz/docs/presets
@@ -10,4 +10,4 @@ declare const plugin: ESLint.Plugin & {
10
10
  configs: Record<ConfigName, Linter.Config>;
11
11
  };
12
12
  //#endregion
13
- export { plugin as default };
13
+ export { finalPlugin as default };
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
- import react from "eslint-plugin-react-x";
2
1
  import reactNamingConvention from "eslint-plugin-react-naming-convention";
3
2
  import reactWebApi from "eslint-plugin-react-web-api";
4
3
  import reactDom from "eslint-plugin-react-dom";
4
+ import reactJsx from "eslint-plugin-react-jsx";
5
5
  import reactRsc from "eslint-plugin-react-rsc";
6
6
  import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";
7
+ import reactX from "eslint-plugin-react-x";
7
8
 
8
9
  //#region \0rolldown/runtime.js
9
10
  var __defProp = Object.defineProperty;
@@ -21,61 +22,63 @@ var __exportAll = (all, no_symbols) => {
21
22
  return target;
22
23
  };
23
24
 
24
- //#endregion
25
- //#region package.json
26
- var name$19 = "@eslint-react/eslint-plugin";
27
- var version = "3.0.0-rc.5";
28
-
29
25
  //#endregion
30
26
  //#region src/configs/dom.ts
31
27
  var dom_exports = /* @__PURE__ */ __exportAll({
32
- name: () => name$18,
33
- plugins: () => plugins$10,
34
- rules: () => rules$19
28
+ name: () => name$21,
29
+ rules: () => rules$21
35
30
  });
36
- const name$18 = "@eslint-react/dom";
37
- const rules$19 = {
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-namespace": "error",
44
- "@eslint-react/dom/no-render": "error",
45
- "@eslint-react/dom/no-render-return-value": "error",
46
- "@eslint-react/dom/no-script-url": "warn",
47
- "@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
48
- "@eslint-react/dom/no-use-form-state": "error",
49
- "@eslint-react/dom/no-void-elements-with-children": "error"
31
+ const name$21 = "@eslint-react/dom";
32
+ const rules$21 = {
33
+ "@eslint-react/dom-no-dangerously-set-innerhtml": "warn",
34
+ "@eslint-react/dom-no-dangerously-set-innerhtml-with-children": "error",
35
+ "@eslint-react/dom-no-find-dom-node": "error",
36
+ "@eslint-react/dom-no-flush-sync": "error",
37
+ "@eslint-react/dom-no-hydrate": "error",
38
+ "@eslint-react/dom-no-render": "error",
39
+ "@eslint-react/dom-no-render-return-value": "error",
40
+ "@eslint-react/dom-no-script-url": "warn",
41
+ "@eslint-react/dom-no-unsafe-iframe-sandbox": "warn",
42
+ "@eslint-react/dom-no-use-form-state": "error",
43
+ "@eslint-react/dom-no-void-elements-with-children": "error"
44
+ };
45
+
46
+ //#endregion
47
+ //#region src/configs/jsx.ts
48
+ var jsx_exports = /* @__PURE__ */ __exportAll({
49
+ name: () => name$20,
50
+ rules: () => rules$20
51
+ });
52
+ const name$20 = "@eslint-react/jsx";
53
+ const rules$20 = {
54
+ "@eslint-react/jsx-no-children-prop": "warn",
55
+ "@eslint-react/jsx-no-children-prop-with-children": "error",
56
+ "@eslint-react/jsx-no-comment-textnodes": "warn",
57
+ "@eslint-react/jsx-no-deoptimization": "error",
58
+ "@eslint-react/jsx-no-namespace": "error"
50
59
  };
51
- const plugins$10 = { "@eslint-react/dom": reactDom };
52
60
 
53
61
  //#endregion
54
62
  //#region src/configs/rsc.ts
55
63
  var rsc_exports = /* @__PURE__ */ __exportAll({
56
- name: () => name$17,
57
- plugins: () => plugins$9,
58
- rules: () => rules$18
64
+ name: () => name$19,
65
+ rules: () => rules$19
59
66
  });
60
- const name$17 = "@eslint-react/rsc";
61
- const rules$18 = { "@eslint-react/rsc/function-definition": "error" };
62
- const plugins$9 = { "@eslint-react/rsc": reactRsc };
67
+ const name$19 = "@eslint-react/rsc";
68
+ const rules$19 = { "@eslint-react/rsc-function-definition": "error" };
63
69
 
64
70
  //#endregion
65
71
  //#region src/configs/x.ts
66
72
  var x_exports = /* @__PURE__ */ __exportAll({
67
- name: () => name$16,
68
- plugins: () => plugins$8,
69
- rules: () => rules$17,
73
+ name: () => name$18,
74
+ rules: () => rules$18,
70
75
  settings: () => settings$8
71
76
  });
72
- const name$16 = "@eslint-react/x";
73
- const rules$17 = {
77
+ const name$18 = "@eslint-react/x";
78
+ const rules$18 = {
74
79
  "@eslint-react/component-hook-factories": "error",
75
80
  "@eslint-react/error-boundaries": "error",
76
81
  "@eslint-react/exhaustive-deps": "warn",
77
- "@eslint-react/jsx-key-before-spread": "warn",
78
- "@eslint-react/jsx-no-comment-textnodes": "warn",
79
82
  "@eslint-react/no-access-state-in-setstate": "error",
80
83
  "@eslint-react/no-array-index-key": "warn",
81
84
  "@eslint-react/no-children-count": "warn",
@@ -112,35 +115,27 @@ const rules$17 = {
112
115
  "@eslint-react/use-memo": "error",
113
116
  "@eslint-react/use-state": "warn"
114
117
  };
115
- const plugins$8 = { "@eslint-react": react };
116
118
  const settings$8 = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
117
119
 
118
120
  //#endregion
119
121
  //#region src/configs/all.ts
120
122
  var all_exports = /* @__PURE__ */ __exportAll({
121
- name: () => name$15,
122
- plugins: () => plugins$7,
123
- rules: () => rules$16,
123
+ name: () => name$17,
124
+ rules: () => rules$17,
124
125
  settings: () => settings$7
125
126
  });
126
- const name$15 = "@eslint-react/all";
127
- const rules$16 = {
127
+ const name$17 = "@eslint-react/all";
128
+ const rules$17 = {
128
129
  "@eslint-react/component-hook-factories": "error",
129
130
  "@eslint-react/error-boundaries": "error",
130
131
  "@eslint-react/exhaustive-deps": "warn",
131
132
  "@eslint-react/immutability": "error",
132
- "@eslint-react/jsx-dollar": "warn",
133
- "@eslint-react/jsx-key-before-spread": "warn",
134
- "@eslint-react/jsx-no-comment-textnodes": "warn",
135
- "@eslint-react/jsx-shorthand-boolean": "warn",
136
- "@eslint-react/jsx-shorthand-fragment": "warn",
137
133
  "@eslint-react/no-access-state-in-setstate": "error",
138
134
  "@eslint-react/no-array-index-key": "warn",
139
135
  "@eslint-react/no-children-count": "warn",
140
136
  "@eslint-react/no-children-for-each": "warn",
141
137
  "@eslint-react/no-children-map": "warn",
142
138
  "@eslint-react/no-children-only": "warn",
143
- "@eslint-react/no-children-prop": "warn",
144
139
  "@eslint-react/no-children-to-array": "warn",
145
140
  "@eslint-react/no-class-component": "warn",
146
141
  "@eslint-react/no-clone-element": "warn",
@@ -173,7 +168,6 @@ const rules$16 = {
173
168
  "@eslint-react/no-unused-class-component-members": "warn",
174
169
  "@eslint-react/no-unused-state": "warn",
175
170
  "@eslint-react/no-use-context": "warn",
176
- "@eslint-react/no-useless-fragment": "warn",
177
171
  "@eslint-react/prefer-destructuring-assignment": "warn",
178
172
  "@eslint-react/prefer-namespace-import": "warn",
179
173
  "@eslint-react/purity": "warn",
@@ -184,79 +178,76 @@ const rules$16 = {
184
178
  "@eslint-react/unsupported-syntax": "error",
185
179
  "@eslint-react/use-memo": "error",
186
180
  "@eslint-react/use-state": "warn",
187
- "@eslint-react/dom/no-dangerously-set-innerhtml": "warn",
188
- "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
189
- "@eslint-react/dom/no-find-dom-node": "error",
190
- "@eslint-react/dom/no-flush-sync": "error",
191
- "@eslint-react/dom/no-hydrate": "error",
192
- "@eslint-react/dom/no-missing-button-type": "warn",
193
- "@eslint-react/dom/no-missing-iframe-sandbox": "warn",
194
- "@eslint-react/dom/no-namespace": "error",
195
- "@eslint-react/dom/no-render": "error",
196
- "@eslint-react/dom/no-render-return-value": "error",
197
- "@eslint-react/dom/no-script-url": "warn",
198
- "@eslint-react/dom/no-string-style-prop": "error",
199
- "@eslint-react/dom/no-unknown-property": "warn",
200
- "@eslint-react/dom/no-unsafe-iframe-sandbox": "warn",
201
- "@eslint-react/dom/no-unsafe-target-blank": "warn",
202
- "@eslint-react/dom/no-use-form-state": "warn",
203
- "@eslint-react/dom/no-void-elements-with-children": "error",
204
- "@eslint-react/dom/prefer-namespace-import": "warn",
205
- "@eslint-react/rsc/function-definition": "error",
206
- "@eslint-react/web-api/no-leaked-event-listener": "warn",
207
- "@eslint-react/web-api/no-leaked-interval": "warn",
208
- "@eslint-react/web-api/no-leaked-resize-observer": "warn",
209
- "@eslint-react/web-api/no-leaked-timeout": "warn",
210
- "@eslint-react/naming-convention/context-name": "warn",
211
- "@eslint-react/naming-convention/id-name": "warn",
212
- "@eslint-react/naming-convention/ref-name": "warn"
213
- };
214
- const plugins$7 = {
215
- ...plugins$8,
216
- ...plugins$9,
217
- ...plugins$10,
218
- "@eslint-react/naming-convention": reactNamingConvention,
219
- "@eslint-react/web-api": reactWebApi
181
+ "@eslint-react/jsx-no-children-prop": "warn",
182
+ "@eslint-react/jsx-no-children-prop-with-children": "error",
183
+ "@eslint-react/jsx-no-comment-textnodes": "warn",
184
+ "@eslint-react/jsx-no-deoptimization": "error",
185
+ "@eslint-react/jsx-no-namespace": "error",
186
+ "@eslint-react/jsx-no-useless-fragment": "warn",
187
+ "@eslint-react/rsc-function-definition": "error",
188
+ "@eslint-react/dom-no-dangerously-set-innerhtml": "warn",
189
+ "@eslint-react/dom-no-dangerously-set-innerhtml-with-children": "error",
190
+ "@eslint-react/dom-no-find-dom-node": "error",
191
+ "@eslint-react/dom-no-flush-sync": "error",
192
+ "@eslint-react/dom-no-hydrate": "error",
193
+ "@eslint-react/dom-no-missing-button-type": "warn",
194
+ "@eslint-react/dom-no-missing-iframe-sandbox": "warn",
195
+ "@eslint-react/dom-no-render": "error",
196
+ "@eslint-react/dom-no-render-return-value": "error",
197
+ "@eslint-react/dom-no-script-url": "warn",
198
+ "@eslint-react/dom-no-string-style-prop": "error",
199
+ "@eslint-react/dom-no-unknown-property": "warn",
200
+ "@eslint-react/dom-no-unsafe-iframe-sandbox": "warn",
201
+ "@eslint-react/dom-no-unsafe-target-blank": "warn",
202
+ "@eslint-react/dom-no-use-form-state": "warn",
203
+ "@eslint-react/dom-no-void-elements-with-children": "error",
204
+ "@eslint-react/dom-prefer-namespace-import": "warn",
205
+ "@eslint-react/web-api-no-leaked-event-listener": "warn",
206
+ "@eslint-react/web-api-no-leaked-interval": "warn",
207
+ "@eslint-react/web-api-no-leaked-resize-observer": "warn",
208
+ "@eslint-react/web-api-no-leaked-timeout": "warn",
209
+ "@eslint-react/naming-convention-context-name": "warn",
210
+ "@eslint-react/naming-convention-id-name": "warn",
211
+ "@eslint-react/naming-convention-ref-name": "warn"
220
212
  };
221
213
  const settings$7 = { ...settings$8 };
222
214
 
223
215
  //#endregion
224
216
  //#region src/configs/disable-conflict-eslint-plugin-react.ts
225
217
  var disable_conflict_eslint_plugin_react_exports = /* @__PURE__ */ __exportAll({
226
- name: () => name$14,
227
- rules: () => rules$15
218
+ name: () => name$16,
219
+ rules: () => rules$16
228
220
  });
229
- const name$14 = "@eslint-react/disable-conflict-eslint-plugin-react";
230
- const rules$15 = react.configs["disable-conflict-eslint-plugin-react"].rules ?? {};
221
+ const name$16 = "@eslint-react/disable-conflict-eslint-plugin-react";
222
+ const rules$16 = reactX.configs["disable-conflict-eslint-plugin-react"].rules ?? {};
231
223
 
232
224
  //#endregion
233
225
  //#region src/configs/disable-conflict-eslint-plugin-react-hooks.ts
234
226
  var disable_conflict_eslint_plugin_react_hooks_exports = /* @__PURE__ */ __exportAll({
235
- name: () => name$13,
236
- rules: () => rules$14
227
+ name: () => name$15,
228
+ rules: () => rules$15
237
229
  });
238
- const name$13 = "@eslint-react/disable-conflict-eslint-plugin-react-hooks";
239
- const rules$14 = react.configs["disable-conflict-eslint-plugin-react-hooks"].rules ?? {};
230
+ const name$15 = "@eslint-react/disable-conflict-eslint-plugin-react-hooks";
231
+ const rules$15 = reactX.configs["disable-conflict-eslint-plugin-react-hooks"].rules ?? {};
240
232
 
241
233
  //#endregion
242
234
  //#region src/configs/disable-dom.ts
243
235
  var disable_dom_exports = /* @__PURE__ */ __exportAll({
244
- name: () => name$12,
245
- rules: () => rules$13
236
+ name: () => name$14,
237
+ rules: () => rules$14
246
238
  });
247
- const name$12 = "@eslint-react/disable-dom";
248
- const rules$13 = Object.fromEntries(Object.entries(rules$19).map(([key]) => [key, "off"]));
239
+ const name$14 = "@eslint-react/disable-dom";
240
+ const rules$14 = Object.fromEntries(Object.entries(rules$21).map(([key]) => [key, "off"]));
249
241
 
250
242
  //#endregion
251
243
  //#region src/configs/disable-experimental.ts
252
244
  var disable_experimental_exports = /* @__PURE__ */ __exportAll({
253
- name: () => name$11,
254
- rules: () => rules$12
245
+ name: () => name$13,
246
+ rules: () => rules$13
255
247
  });
256
- const name$11 = "@eslint-react/disable-experimental";
257
- const rules$12 = {
248
+ const name$13 = "@eslint-react/disable-experimental";
249
+ const rules$13 = {
258
250
  "@eslint-react/immutability": "off",
259
- "@eslint-react/jsx-key-before-spread": "off",
260
251
  "@eslint-react/no-duplicate-key": "off",
261
252
  "@eslint-react/no-implicit-children": "off",
262
253
  "@eslint-react/no-implicit-key": "off",
@@ -269,25 +260,36 @@ const rules$12 = {
269
260
  "@eslint-react/set-state-in-render": "off",
270
261
  "@eslint-react/unstable-rules-of-props": "off",
271
262
  "@eslint-react/unstable-rules-of-state": "off",
272
- "@eslint-react/rsc/function-definition": "off"
263
+ "@eslint-react/jsx-no-deoptimization": "off",
264
+ "@eslint-react/jsx-no-namespace": "off",
265
+ "@eslint-react/rsc-function-definition": "off"
273
266
  };
274
267
 
268
+ //#endregion
269
+ //#region src/configs/disable-jsx.ts
270
+ var disable_jsx_exports = /* @__PURE__ */ __exportAll({
271
+ name: () => name$12,
272
+ rules: () => rules$12
273
+ });
274
+ const name$12 = "@eslint-react/disable-jsx";
275
+ const rules$12 = Object.fromEntries(Object.entries(rules$20).map(([key]) => [key, "off"]));
276
+
275
277
  //#endregion
276
278
  //#region src/configs/disable-rsc.ts
277
279
  var disable_rsc_exports = /* @__PURE__ */ __exportAll({
278
- name: () => name$10,
280
+ name: () => name$11,
279
281
  rules: () => rules$11
280
282
  });
281
- const name$10 = "@eslint-react/disable-rsc";
282
- const rules$11 = Object.fromEntries(Object.entries(rules$18).map(([key]) => [key, "off"]));
283
+ const name$11 = "@eslint-react/disable-rsc";
284
+ const rules$11 = Object.fromEntries(Object.entries(rules$19).map(([key]) => [key, "off"]));
283
285
 
284
286
  //#endregion
285
287
  //#region src/configs/disable-type-checked.ts
286
288
  var disable_type_checked_exports = /* @__PURE__ */ __exportAll({
287
- name: () => name$9,
289
+ name: () => name$10,
288
290
  rules: () => rules$10
289
291
  });
290
- const name$9 = "@eslint-react/disable-type-checked";
292
+ const name$10 = "@eslint-react/disable-type-checked";
291
293
  const rules$10 = {
292
294
  "@eslint-react/no-implicit-children": "off",
293
295
  "@eslint-react/no-implicit-key": "off",
@@ -299,68 +301,59 @@ const rules$10 = {
299
301
  //#endregion
300
302
  //#region src/configs/web-api.ts
301
303
  var web_api_exports = /* @__PURE__ */ __exportAll({
302
- name: () => name$8,
303
- plugins: () => plugins$6,
304
+ name: () => name$9,
304
305
  rules: () => rules$9,
305
306
  settings: () => settings$6
306
307
  });
307
- const name$8 = "@eslint-react/web-api";
308
+ const name$9 = "@eslint-react/web-api";
308
309
  const rules$9 = {
309
- "@eslint-react/web-api/no-leaked-event-listener": "warn",
310
- "@eslint-react/web-api/no-leaked-interval": "warn",
311
- "@eslint-react/web-api/no-leaked-resize-observer": "warn",
312
- "@eslint-react/web-api/no-leaked-timeout": "warn"
310
+ "@eslint-react/web-api-no-leaked-event-listener": "warn",
311
+ "@eslint-react/web-api-no-leaked-interval": "warn",
312
+ "@eslint-react/web-api-no-leaked-resize-observer": "warn",
313
+ "@eslint-react/web-api-no-leaked-timeout": "warn"
313
314
  };
314
- const plugins$6 = { "@eslint-react/web-api": reactWebApi };
315
315
  const settings$6 = { ...settings$8 };
316
316
 
317
317
  //#endregion
318
318
  //#region src/configs/disable-web-api.ts
319
319
  var disable_web_api_exports = /* @__PURE__ */ __exportAll({
320
- name: () => name$7,
320
+ name: () => name$8,
321
321
  rules: () => rules$8
322
322
  });
323
- const name$7 = "@eslint-react/disable-web-api";
323
+ const name$8 = "@eslint-react/disable-web-api";
324
324
  const rules$8 = Object.fromEntries(Object.entries(rules$9).map(([key]) => [key, "off"]));
325
325
 
326
326
  //#endregion
327
327
  //#region src/configs/off.ts
328
328
  var off_exports = /* @__PURE__ */ __exportAll({
329
- name: () => name$6,
329
+ name: () => name$7,
330
330
  rules: () => rules$7
331
331
  });
332
- const name$6 = "@eslint-react/off";
332
+ const name$7 = "@eslint-react/off";
333
333
  const rules$7 = {
334
- ...Object.fromEntries(Object.entries(rules$16).map(([key]) => [key, "off"])),
334
+ ...Object.fromEntries(Object.entries(rules$17).map(([key]) => [key, "off"])),
335
335
  ...rules$10
336
336
  };
337
337
 
338
338
  //#endregion
339
339
  //#region src/configs/recommended.ts
340
340
  var recommended_exports = /* @__PURE__ */ __exportAll({
341
- name: () => name$5,
342
- plugins: () => plugins$5,
341
+ name: () => name$6,
343
342
  rules: () => rules$6,
344
343
  settings: () => settings$5
345
344
  });
346
- const name$5 = "@eslint-react/recommended";
345
+ const name$6 = "@eslint-react/recommended";
347
346
  const rules$6 = {
348
- ...rules$17,
349
347
  ...rules$18,
348
+ ...rules$20,
350
349
  ...rules$19,
350
+ ...rules$21,
351
351
  ...rules$9,
352
- "@eslint-react/naming-convention/context-name": "warn",
353
- "@eslint-react/naming-convention/id-name": "warn",
354
- "@eslint-react/naming-convention/ref-name": "warn",
352
+ "@eslint-react/naming-convention-context-name": "warn",
353
+ "@eslint-react/naming-convention-id-name": "warn",
354
+ "@eslint-react/naming-convention-ref-name": "warn",
355
355
  "@eslint-react/use-state": "warn"
356
356
  };
357
- const plugins$5 = {
358
- ...plugins$8,
359
- ...plugins$9,
360
- ...plugins$10,
361
- ...plugins$6,
362
- "@eslint-react/naming-convention": reactNamingConvention
363
- };
364
357
  const settings$5 = { ...settings$8 };
365
358
 
366
359
  //#endregion
@@ -369,54 +362,48 @@ const settings$5 = { ...settings$8 };
369
362
  * Disables rules that are already handled by TypeScript
370
363
  */
371
364
  const rules$5 = {
372
- "@eslint-react/dom/no-string-style-prop": "off",
373
- "@eslint-react/dom/no-unknown-property": "off"
365
+ "@eslint-react/dom-no-string-style-prop": "off",
366
+ "@eslint-react/dom-no-unknown-property": "off"
374
367
  };
375
368
 
376
369
  //#endregion
377
370
  //#region src/configs/recommended-typescript.ts
378
371
  var recommended_typescript_exports = /* @__PURE__ */ __exportAll({
379
- name: () => name$4,
380
- plugins: () => plugins$4,
372
+ name: () => name$5,
381
373
  rules: () => rules$4,
382
374
  settings: () => settings$4
383
375
  });
384
- const name$4 = "@eslint-react/recommended-typescript";
376
+ const name$5 = "@eslint-react/recommended-typescript";
385
377
  const rules$4 = {
386
378
  ...rules$6,
387
379
  ...rules$5
388
380
  };
389
- const plugins$4 = { ...plugins$5 };
390
381
  const settings$4 = { ...settings$5 };
391
382
 
392
383
  //#endregion
393
384
  //#region src/configs/recommended-type-checked.ts
394
385
  var recommended_type_checked_exports = /* @__PURE__ */ __exportAll({
395
- name: () => name$3,
396
- plugins: () => plugins$3,
386
+ name: () => name$4,
397
387
  rules: () => rules$3,
398
388
  settings: () => settings$3
399
389
  });
400
- const name$3 = "@eslint-react/recommended-type-checked";
390
+ const name$4 = "@eslint-react/recommended-type-checked";
401
391
  const rules$3 = {
402
392
  ...rules$4,
403
393
  "@eslint-react/no-leaked-conditional-rendering": "error"
404
394
  };
405
- const plugins$3 = { ...plugins$4 };
406
395
  const settings$3 = { ...settings$4 };
407
396
 
408
397
  //#endregion
409
398
  //#region src/configs/strict.ts
410
399
  var strict_exports = /* @__PURE__ */ __exportAll({
411
- name: () => name$2,
412
- plugins: () => plugins$2,
400
+ name: () => name$3,
413
401
  rules: () => rules$2,
414
402
  settings: () => settings$2
415
403
  });
416
- const name$2 = "@eslint-react/strict";
404
+ const name$3 = "@eslint-react/strict";
417
405
  const rules$2 = {
418
406
  ...rules$6,
419
- "@eslint-react/no-children-prop": "error",
420
407
  "@eslint-react/no-class-component": "error",
421
408
  "@eslint-react/no-misused-capture-owner-stack": "error",
422
409
  "@eslint-react/no-unnecessary-use-callback": "warn",
@@ -424,78 +411,140 @@ const rules$2 = {
424
411
  "@eslint-react/no-unstable-context-value": "warn",
425
412
  "@eslint-react/no-unstable-default-props": "warn",
426
413
  "@eslint-react/no-unused-state": "warn",
427
- "@eslint-react/no-useless-fragment": "warn",
428
414
  "@eslint-react/prefer-destructuring-assignment": "warn",
429
- "@eslint-react/dom/no-missing-button-type": "warn",
430
- "@eslint-react/dom/no-missing-iframe-sandbox": "warn",
431
- "@eslint-react/dom/no-unsafe-target-blank": "warn"
415
+ "@eslint-react/jsx-no-children-prop": "error",
416
+ "@eslint-react/jsx-no-useless-fragment": "warn",
417
+ "@eslint-react/dom-no-missing-button-type": "warn",
418
+ "@eslint-react/dom-no-missing-iframe-sandbox": "warn",
419
+ "@eslint-react/dom-no-unsafe-target-blank": "warn"
432
420
  };
433
- const plugins$2 = { ...plugins$5 };
434
421
  const settings$2 = { ...settings$5 };
435
422
 
436
423
  //#endregion
437
424
  //#region src/configs/strict-typescript.ts
438
425
  var strict_typescript_exports = /* @__PURE__ */ __exportAll({
439
- name: () => name$1,
440
- plugins: () => plugins$1,
426
+ name: () => name$2,
441
427
  rules: () => rules$1,
442
428
  settings: () => settings$1
443
429
  });
444
- const name$1 = "@eslint-react/strict-typescript";
430
+ const name$2 = "@eslint-react/strict-typescript";
445
431
  const rules$1 = {
446
432
  ...rules$2,
447
- ...rules$4
433
+ ...rules$5
448
434
  };
449
- const plugins$1 = { ...plugins$2 };
450
435
  const settings$1 = { ...settings$2 };
451
436
 
452
437
  //#endregion
453
438
  //#region src/configs/strict-type-checked.ts
454
439
  var strict_type_checked_exports = /* @__PURE__ */ __exportAll({
455
- name: () => name,
456
- plugins: () => plugins,
440
+ name: () => name$1,
457
441
  rules: () => rules,
458
442
  settings: () => settings
459
443
  });
460
- const name = "@eslint-react/strict-type-checked";
444
+ const name$1 = "@eslint-react/strict-type-checked";
461
445
  const rules = {
462
446
  ...rules$1,
463
447
  "@eslint-react/no-leaked-conditional-rendering": "error",
464
448
  "@eslint-react/no-unused-props": "warn"
465
449
  };
466
- const plugins = { ...plugins$1 };
467
450
  const settings = { ...settings$1 };
468
451
 
469
452
  //#endregion
470
- //#region src/index.ts
453
+ //#region package.json
454
+ var name = "@eslint-react/eslint-plugin";
455
+ var version = "4.0.0-beta.1";
456
+
457
+ //#endregion
458
+ //#region src/utils/type-of.ts
459
+ /**
460
+ * This is an enhanced version of the typeof operator to check the type of more complex values.
461
+ * In this case we just mind about arrays and objects. We can add more on demand.
462
+ * @param t the value to be checked
463
+ * @returns the type of the value
464
+ */
465
+ function typeOf(t) {
466
+ return Object.prototype.toString.call(t).replace(/^\[object (.+)\]$/, "$1").toLowerCase();
467
+ }
468
+
469
+ //#endregion
470
+ //#region src/utils/transform-keys.ts
471
+ /**
472
+ * This function is used to shallowly transform the keys of an object.
473
+ * It will only be transformed at runtime, so it's not type safe.
474
+ * @param obj the object to transform.
475
+ * @param transform the function to transform the keys from string to string.
476
+ * @returns the transformed object.
477
+ * @example transformKeys({ 'foo-bar': { 'fizz-buzz': true } }, camelCase)
478
+ * // { fooBar: { 'fizz-buzz': true } }
479
+ */
480
+ function transformKeys(obj, transform) {
481
+ if (typeOf(obj) !== "object") return obj;
482
+ const res = {};
483
+ for (const key in obj) res[transform(key)] = obj[key];
484
+ return res;
485
+ }
486
+
487
+ //#endregion
488
+ //#region src/utils/pad-keys-left.ts
489
+ function padKeysLeft(obj, left) {
490
+ return transformKeys(obj, (key) => `${left}${key}`);
491
+ }
492
+
493
+ //#endregion
494
+ //#region src/plugin.ts
471
495
  const plugin = {
472
496
  meta: {
473
- name: name$19,
497
+ name,
474
498
  version
475
499
  },
500
+ rules: {
501
+ ...reactX.rules,
502
+ ...padKeysLeft(reactX.rules, "x-"),
503
+ ...padKeysLeft(reactJsx.rules, "jsx-"),
504
+ ...padKeysLeft(reactRsc.rules, "rsc-"),
505
+ ...padKeysLeft(reactDom.rules, "dom-"),
506
+ ...padKeysLeft(reactWebApi.rules, "web-api-"),
507
+ ...padKeysLeft(reactNamingConvention.rules, "naming-convention-")
508
+ }
509
+ };
510
+
511
+ //#endregion
512
+ //#region src/index.ts
513
+ function createConfig(base) {
514
+ return {
515
+ ...base,
516
+ plugins: {
517
+ ...base.plugins,
518
+ "@eslint-react": plugin
519
+ }
520
+ };
521
+ }
522
+ const finalPlugin = {
523
+ ...plugin,
476
524
  configs: {
477
- ["all"]: all_exports,
478
- ["disable-conflict-eslint-plugin-react"]: disable_conflict_eslint_plugin_react_exports,
479
- ["disable-conflict-eslint-plugin-react-hooks"]: disable_conflict_eslint_plugin_react_hooks_exports,
480
- ["disable-dom"]: disable_dom_exports,
481
- ["disable-experimental"]: disable_experimental_exports,
482
- ["disable-rsc"]: disable_rsc_exports,
483
- ["disable-type-checked"]: disable_type_checked_exports,
484
- ["disable-web-api"]: disable_web_api_exports,
485
- ["dom"]: dom_exports,
486
- ["off"]: off_exports,
487
- ["recommended"]: recommended_exports,
488
- ["recommended-type-checked"]: recommended_type_checked_exports,
489
- ["recommended-typescript"]: recommended_typescript_exports,
490
- ["rsc"]: rsc_exports,
491
- ["strict"]: strict_exports,
492
- ["strict-type-checked"]: strict_type_checked_exports,
493
- ["strict-typescript"]: strict_typescript_exports,
494
- ["web-api"]: web_api_exports,
495
- ["x"]: x_exports
496
- },
497
- rules: { ...react.rules }
525
+ ["all"]: createConfig(all_exports),
526
+ ["disable-conflict-eslint-plugin-react"]: createConfig(disable_conflict_eslint_plugin_react_exports),
527
+ ["disable-conflict-eslint-plugin-react-hooks"]: createConfig(disable_conflict_eslint_plugin_react_hooks_exports),
528
+ ["disable-dom"]: createConfig(disable_dom_exports),
529
+ ["disable-experimental"]: createConfig(disable_experimental_exports),
530
+ ["disable-jsx"]: createConfig(disable_jsx_exports),
531
+ ["disable-rsc"]: createConfig(disable_rsc_exports),
532
+ ["disable-type-checked"]: createConfig(disable_type_checked_exports),
533
+ ["disable-web-api"]: createConfig(disable_web_api_exports),
534
+ ["dom"]: createConfig(dom_exports),
535
+ ["jsx"]: createConfig(jsx_exports),
536
+ ["off"]: createConfig(off_exports),
537
+ ["recommended"]: createConfig(recommended_exports),
538
+ ["recommended-type-checked"]: createConfig(recommended_type_checked_exports),
539
+ ["recommended-typescript"]: createConfig(recommended_typescript_exports),
540
+ ["rsc"]: createConfig(rsc_exports),
541
+ ["strict"]: createConfig(strict_exports),
542
+ ["strict-type-checked"]: createConfig(strict_type_checked_exports),
543
+ ["strict-typescript"]: createConfig(strict_typescript_exports),
544
+ ["web-api"]: createConfig(web_api_exports),
545
+ ["x"]: createConfig(x_exports)
546
+ }
498
547
  };
499
548
 
500
549
  //#endregion
501
- export { plugin as default };
550
+ export { finalPlugin as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/eslint-plugin",
3
- "version": "3.0.0-rc.5",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "A unified plugin that combines all individual plugins from the eslint-react monorepo into one.",
5
5
  "keywords": [
6
6
  "react",
@@ -8,6 +8,7 @@
8
8
  "eslint-react",
9
9
  "eslint-plugin",
10
10
  "eslint-plugin-react-x",
11
+ "eslint-plugin-react-jsx",
11
12
  "eslint-plugin-react-rsc",
12
13
  "eslint-plugin-react-dom",
13
14
  "eslint-plugin-react-web-api",
@@ -41,20 +42,21 @@
41
42
  "./package.json"
42
43
  ],
43
44
  "dependencies": {
44
- "@typescript-eslint/scope-manager": "^8.57.0",
45
- "@typescript-eslint/type-utils": "^8.57.0",
46
- "@typescript-eslint/types": "^8.57.0",
47
- "@typescript-eslint/utils": "^8.57.0",
48
- "ts-api-utils": "^2.4.0",
49
- "@eslint-react/shared": "3.0.0-rc.5",
50
- "eslint-plugin-react-dom": "3.0.0-rc.5",
51
- "eslint-plugin-react-naming-convention": "3.0.0-rc.5",
52
- "eslint-plugin-react-rsc": "3.0.0-rc.5",
53
- "eslint-plugin-react-web-api": "3.0.0-rc.5",
54
- "eslint-plugin-react-x": "3.0.0-rc.5"
45
+ "@typescript-eslint/scope-manager": "^8.57.2",
46
+ "@typescript-eslint/type-utils": "^8.57.2",
47
+ "@typescript-eslint/types": "^8.57.2",
48
+ "@typescript-eslint/utils": "^8.57.2",
49
+ "ts-api-utils": "^2.5.0",
50
+ "@eslint-react/shared": "4.0.0-beta.1",
51
+ "eslint-plugin-react-dom": "4.0.0-beta.1",
52
+ "eslint-plugin-react-jsx": "4.0.0-beta.1",
53
+ "eslint-plugin-react-naming-convention": "4.0.0-beta.1",
54
+ "eslint-plugin-react-rsc": "4.0.0-beta.1",
55
+ "eslint-plugin-react-web-api": "4.0.0-beta.1",
56
+ "eslint-plugin-react-x": "4.0.0-beta.1"
55
57
  },
56
58
  "devDependencies": {
57
- "tsdown": "^0.21.2",
59
+ "tsdown": "^0.21.4",
58
60
  "@local/configs": "0.0.0",
59
61
  "@local/eff": "3.0.0-beta.72"
60
62
  },