eslint-plugin-react-debug 1.52.10-next.0 → 1.52.10-next.2

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.d.mts CHANGED
@@ -1,23 +1,24 @@
1
- import * as _eslint_react_kit from '@eslint-react/kit';
1
+ import * as _eslint_react_kit0 from "@eslint-react/kit";
2
2
 
3
+ //#region src/index.d.ts
3
4
  declare const _default: {
4
- configs: {
5
- all: {
6
- plugins: {};
7
- name?: string;
8
- rules?: Record<string, _eslint_react_kit.RuleConfig>;
9
- settings?: _eslint_react_kit.SettingsConfig;
10
- };
11
- "all-legacy": {
12
- plugins: string[];
13
- rules: Record<string, _eslint_react_kit.RuleConfig<unknown[]>> | undefined;
14
- };
5
+ configs: {
6
+ all: {
7
+ plugins: {};
8
+ name?: string;
9
+ rules?: Record<string, _eslint_react_kit0.RuleConfig>;
10
+ settings?: _eslint_react_kit0.SettingsConfig;
15
11
  };
16
- meta: {
17
- name: string;
18
- version: string;
12
+ "all-legacy": {
13
+ plugins: string[];
14
+ rules: Record<string, _eslint_react_kit0.RuleConfig<unknown[]>> | undefined;
19
15
  };
20
- rules: Record<string, _eslint_react_kit.CompatibleRule>;
16
+ };
17
+ meta: {
18
+ name: string;
19
+ version: string;
20
+ };
21
+ rules: Record<string, _eslint_react_kit0.CompatibleRule>;
21
22
  };
22
-
23
- export { _default as default };
23
+ //#endregion
24
+ export { _default as default };
package/dist/index.d.ts CHANGED
@@ -1,23 +1,23 @@
1
- import * as _eslint_react_kit from '@eslint-react/kit';
1
+ import * as _eslint_react_kit0 from "@eslint-react/kit";
2
2
 
3
+ //#region src/index.d.ts
3
4
  declare const _default: {
4
- configs: {
5
- all: {
6
- plugins: {};
7
- name?: string;
8
- rules?: Record<string, _eslint_react_kit.RuleConfig>;
9
- settings?: _eslint_react_kit.SettingsConfig;
10
- };
11
- "all-legacy": {
12
- plugins: string[];
13
- rules: Record<string, _eslint_react_kit.RuleConfig<unknown[]>> | undefined;
14
- };
5
+ configs: {
6
+ all: {
7
+ plugins: {};
8
+ name?: string;
9
+ rules?: Record<string, _eslint_react_kit0.RuleConfig>;
10
+ settings?: _eslint_react_kit0.SettingsConfig;
15
11
  };
16
- meta: {
17
- name: string;
18
- version: string;
12
+ "all-legacy": {
13
+ plugins: string[];
14
+ rules: Record<string, _eslint_react_kit0.RuleConfig<unknown[]>> | undefined;
19
15
  };
20
- rules: Record<string, _eslint_react_kit.CompatibleRule>;
16
+ };
17
+ meta: {
18
+ name: string;
19
+ version: string;
20
+ };
21
+ rules: Record<string, _eslint_react_kit0.CompatibleRule>;
21
22
  };
22
-
23
- export { _default as default };
23
+ export = _default;
package/dist/index.js CHANGED
@@ -1,331 +1,311 @@
1
- 'use strict';
2
-
3
- var shared = require('@eslint-react/shared');
4
- var ER2 = require('@eslint-react/core');
5
- var utils = require('@typescript-eslint/utils');
6
- var eff = require('@eslint-react/eff');
7
- var kit = require('@eslint-react/kit');
8
- var types = require('@typescript-eslint/types');
9
- var tsPattern = require('ts-pattern');
10
-
11
- function _interopNamespace(e) {
12
- if (e && e.__esModule) return e;
13
- var n = Object.create(null);
14
- if (e) {
15
- Object.keys(e).forEach(function (k) {
16
- if (k !== 'default') {
17
- var d = Object.getOwnPropertyDescriptor(e, k);
18
- Object.defineProperty(n, k, d.get ? d : {
19
- enumerable: true,
20
- get: function () { return e[k]; }
21
- });
22
- }
23
- });
24
- }
25
- n.default = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- var ER2__namespace = /*#__PURE__*/_interopNamespace(ER2);
30
-
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
31
3
  var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
32
8
  var __export = (target, all) => {
33
- for (var name3 in all)
34
- __defProp(target, name3, { get: all[name3], enumerable: true });
9
+ for (var name$2 in all) __defProp(target, name$2, {
10
+ get: all[name$2],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
16
+ key = keys[i];
17
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: ((k) => from[k]).bind(null, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ return to;
35
23
  };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
+ value: mod,
26
+ enumerable: true
27
+ }) : target, mod));
36
28
 
37
- // src/configs/all.ts
29
+ //#endregion
30
+ const __eslint_react_shared = __toESM(require("@eslint-react/shared"));
31
+ const __eslint_react_core = __toESM(require("@eslint-react/core"));
32
+ const __typescript_eslint_utils = __toESM(require("@typescript-eslint/utils"));
33
+ const __eslint_react_eff = __toESM(require("@eslint-react/eff"));
34
+ const __eslint_react_kit = __toESM(require("@eslint-react/kit"));
35
+ const __typescript_eslint_types = __toESM(require("@typescript-eslint/types"));
36
+ const ts_pattern = __toESM(require("ts-pattern"));
37
+
38
+ //#region src/configs/all.ts
38
39
  var all_exports = {};
39
40
  __export(all_exports, {
40
- name: () => name,
41
- rules: () => rules,
42
- settings: () => settings
41
+ name: () => name$1,
42
+ rules: () => rules,
43
+ settings: () => settings
43
44
  });
44
- var name = "react-debug/all";
45
- var rules = {
46
- "react-debug/class-component": "warn",
47
- "react-debug/function-component": "warn",
48
- "react-debug/hook": "warn",
49
- "react-debug/is-from-react": "warn",
50
- "react-debug/jsx": "warn"
51
- };
52
- var settings = {
53
- "react-x": shared.DEFAULT_ESLINT_REACT_SETTINGS
45
+ const name$1 = "react-debug/all";
46
+ const rules = {
47
+ "react-debug/class-component": "warn",
48
+ "react-debug/function-component": "warn",
49
+ "react-debug/hook": "warn",
50
+ "react-debug/is-from-react": "warn",
51
+ "react-debug/jsx": "warn"
54
52
  };
53
+ const settings = { "react-x": __eslint_react_shared.DEFAULT_ESLINT_REACT_SETTINGS };
55
54
 
56
- // package.json
57
- var name2 = "eslint-plugin-react-debug";
58
- var version = "1.52.10-next.0";
59
- var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
55
+ //#endregion
56
+ //#region package.json
57
+ var name = "eslint-plugin-react-debug";
58
+ var version = "1.52.10-next.2";
60
59
 
61
- // src/utils/stringify.ts
60
+ //#endregion
61
+ //#region src/utils/create-rule.ts
62
+ const createRule = __typescript_eslint_utils.ESLintUtils.RuleCreator((0, __eslint_react_shared.getDocsUrl)("debug"));
63
+
64
+ //#endregion
65
+ //#region src/utils/stringify.ts
62
66
  function stringify(value) {
63
- return JSON.stringify(value, null, 2);
67
+ return JSON.stringify(value, null, 2);
64
68
  }
65
69
 
66
- // src/rules/class-component.ts
67
- var RULE_NAME = "class-component";
68
- var RULE_FEATURES = [
69
- "DBG"
70
- ];
70
+ //#endregion
71
+ //#region src/rules/class-component.ts
72
+ const RULE_NAME$4 = "class-component";
73
+ const RULE_FEATURES$4 = ["DBG"];
71
74
  var class_component_default = createRule({
72
- meta: {
73
- type: "problem",
74
- docs: {
75
- description: "Reports all class components.",
76
- [Symbol.for("rule_features")]: RULE_FEATURES
77
- },
78
- messages: {
79
- classComponent: "{{json}}"
80
- },
81
- schema: []
82
- },
83
- name: RULE_NAME,
84
- create,
85
- defaultOptions: []
75
+ meta: {
76
+ type: "problem",
77
+ docs: {
78
+ description: "Reports all class components.",
79
+ [Symbol.for("rule_features")]: RULE_FEATURES$4
80
+ },
81
+ messages: { classComponent: "{{json}}" },
82
+ schema: []
83
+ },
84
+ name: RULE_NAME$4,
85
+ create: create$4,
86
+ defaultOptions: []
86
87
  });
87
- function create(context) {
88
- const { ctx, listeners } = ER2__namespace.useComponentCollectorLegacy();
89
- return {
90
- ...listeners,
91
- "Program:exit"(program) {
92
- const components = ctx.getAllComponents(program);
93
- for (const { name: name3 = "anonymous", node: component } of components.values()) {
94
- context.report({
95
- messageId: "classComponent",
96
- node: component,
97
- data: {
98
- json: stringify({ name: name3 })
99
- }
100
- });
101
- }
102
- }
103
- };
88
+ function create$4(context) {
89
+ const { ctx, listeners } = __eslint_react_core.useComponentCollectorLegacy();
90
+ return {
91
+ ...listeners,
92
+ "Program:exit"(program) {
93
+ const components = ctx.getAllComponents(program);
94
+ for (const { name: name$2 = "anonymous", node: component } of components.values()) context.report({
95
+ messageId: "classComponent",
96
+ node: component,
97
+ data: { json: stringify({ name: name$2 }) }
98
+ });
99
+ }
100
+ };
104
101
  }
105
- var RULE_NAME2 = "function-component";
106
- var RULE_FEATURES2 = [
107
- "DBG"
108
- ];
102
+
103
+ //#endregion
104
+ //#region src/rules/function-component.ts
105
+ const RULE_NAME$3 = "function-component";
106
+ const RULE_FEATURES$3 = ["DBG"];
109
107
  var function_component_default = createRule({
110
- meta: {
111
- type: "problem",
112
- docs: {
113
- description: "Reports all function components.",
114
- [Symbol.for("rule_features")]: RULE_FEATURES2
115
- },
116
- messages: {
117
- functionComponent: "{{json}}"
118
- // "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}, displayName: {{displayName}}.",
119
- },
120
- schema: []
121
- },
122
- name: RULE_NAME2,
123
- create: create2,
124
- defaultOptions: []
108
+ meta: {
109
+ type: "problem",
110
+ docs: {
111
+ description: "Reports all function components.",
112
+ [Symbol.for("rule_features")]: RULE_FEATURES$3
113
+ },
114
+ messages: { functionComponent: "{{json}}" },
115
+ schema: []
116
+ },
117
+ name: RULE_NAME$3,
118
+ create: create$3,
119
+ defaultOptions: []
125
120
  });
126
- function create2(context) {
127
- const { ctx, listeners } = ER2__namespace.useComponentCollector(
128
- context,
129
- {
130
- collectDisplayName: true,
131
- collectHookCalls: true,
132
- hint: ER2__namespace.DEFAULT_COMPONENT_DETECTION_HINT
133
- }
134
- );
135
- return {
136
- ...listeners,
137
- "Program:exit"(program) {
138
- const components = ctx.getAllComponents(program);
139
- for (const { name: name3 = "anonymous", node, displayName, flag, hookCalls } of components.values()) {
140
- context.report({
141
- messageId: "functionComponent",
142
- node,
143
- data: {
144
- json: stringify({
145
- name: name3,
146
- displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
147
- forwardRef: (flag & ER2__namespace.ComponentFlag.ForwardRef) > 0n,
148
- hookCalls: hookCalls.length,
149
- memo: (flag & ER2__namespace.ComponentFlag.Memo) > 0n
150
- })
151
- }
152
- });
153
- }
154
- }
155
- };
121
+ function create$3(context) {
122
+ const { ctx, listeners } = __eslint_react_core.useComponentCollector(context, {
123
+ collectDisplayName: true,
124
+ collectHookCalls: true,
125
+ hint: __eslint_react_core.DEFAULT_COMPONENT_DETECTION_HINT
126
+ });
127
+ return {
128
+ ...listeners,
129
+ "Program:exit"(program) {
130
+ const components = ctx.getAllComponents(program);
131
+ for (const { name: name$2 = "anonymous", node, displayName, flag, hookCalls } of components.values()) context.report({
132
+ messageId: "functionComponent",
133
+ node,
134
+ data: { json: stringify({
135
+ name: name$2,
136
+ displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
137
+ forwardRef: (flag & __eslint_react_core.ComponentFlag.ForwardRef) > 0n,
138
+ hookCalls: hookCalls.length,
139
+ memo: (flag & __eslint_react_core.ComponentFlag.Memo) > 0n
140
+ }) }
141
+ });
142
+ }
143
+ };
156
144
  }
157
- var RULE_NAME3 = "hook";
158
- var RULE_FEATURES3 = [
159
- "DBG"
160
- ];
145
+
146
+ //#endregion
147
+ //#region src/rules/hook.ts
148
+ const RULE_NAME$2 = "hook";
149
+ const RULE_FEATURES$2 = ["DBG"];
161
150
  var hook_default = createRule({
162
- meta: {
163
- type: "problem",
164
- docs: {
165
- description: "Reports all React Hooks.",
166
- [Symbol.for("rule_features")]: RULE_FEATURES3
167
- },
168
- messages: {
169
- hook: "{{json}}"
170
- },
171
- schema: []
172
- },
173
- name: RULE_NAME3,
174
- create: create3,
175
- defaultOptions: []
151
+ meta: {
152
+ type: "problem",
153
+ docs: {
154
+ description: "Reports all React Hooks.",
155
+ [Symbol.for("rule_features")]: RULE_FEATURES$2
156
+ },
157
+ messages: { hook: "{{json}}" },
158
+ schema: []
159
+ },
160
+ name: RULE_NAME$2,
161
+ create: create$2,
162
+ defaultOptions: []
176
163
  });
177
- function create3(context) {
178
- const { ctx, listeners } = ER2__namespace.useHookCollector();
179
- return {
180
- ...listeners,
181
- "Program:exit"(program) {
182
- const allHooks = ctx.getAllHooks(program);
183
- for (const { name: name3, node, hookCalls } of allHooks.values()) {
184
- context.report({
185
- messageId: "hook",
186
- node,
187
- data: {
188
- json: stringify({
189
- name: name3,
190
- hookCalls: hookCalls.length
191
- })
192
- }
193
- });
194
- }
195
- }
196
- };
164
+ function create$2(context) {
165
+ const { ctx, listeners } = __eslint_react_core.useHookCollector();
166
+ return {
167
+ ...listeners,
168
+ "Program:exit"(program) {
169
+ const allHooks = ctx.getAllHooks(program);
170
+ for (const { name: name$2, node, hookCalls } of allHooks.values()) context.report({
171
+ messageId: "hook",
172
+ node,
173
+ data: { json: stringify({
174
+ name: name$2,
175
+ hookCalls: hookCalls.length
176
+ }) }
177
+ });
178
+ }
179
+ };
197
180
  }
198
- var RULE_NAME4 = "is-from-react";
199
- var RULE_FEATURES4 = [
200
- "DBG"
201
- ];
181
+
182
+ //#endregion
183
+ //#region src/rules/is-from-react.ts
184
+ const RULE_NAME$1 = "is-from-react";
185
+ const RULE_FEATURES$1 = ["DBG"];
202
186
  var is_from_react_default = createRule({
203
- meta: {
204
- type: "problem",
205
- docs: {
206
- description: "Reports all identifiers that are initialized from React.",
207
- [Symbol.for("rule_features")]: RULE_FEATURES4
208
- },
209
- messages: {
210
- isFromReact: "{{json}}"
211
- },
212
- schema: []
213
- },
214
- name: RULE_NAME4,
215
- create: create4,
216
- defaultOptions: []
187
+ meta: {
188
+ type: "problem",
189
+ docs: {
190
+ description: "Reports all identifiers that are initialized from React.",
191
+ [Symbol.for("rule_features")]: RULE_FEATURES$1
192
+ },
193
+ messages: { isFromReact: "{{json}}" },
194
+ schema: []
195
+ },
196
+ name: RULE_NAME$1,
197
+ create: create$1,
198
+ defaultOptions: []
217
199
  });
218
- function create4(context) {
219
- const { importSource = "react" } = shared.getSettingsFromContext(context);
220
- function visitorFunction(node) {
221
- const shouldSkipDuplicate = node.parent.type === utils.AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name;
222
- if (shouldSkipDuplicate) return;
223
- const name3 = node.name;
224
- const initialScope = context.sourceCode.getScope(node);
225
- if (!isFromReact(node, importSource, initialScope)) return;
226
- context.report({
227
- messageId: "isFromReact",
228
- node,
229
- data: {
230
- json: stringify({
231
- name: name3,
232
- importSource
233
- })
234
- }
235
- });
236
- }
237
- return {
238
- Identifier: visitorFunction,
239
- JSXIdentifier: visitorFunction
240
- };
200
+ function create$1(context) {
201
+ const { importSource = "react" } = (0, __eslint_react_shared.getSettingsFromContext)(context);
202
+ function visitorFunction(node) {
203
+ const shouldSkipDuplicate = node.parent.type === __typescript_eslint_utils.AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name;
204
+ if (shouldSkipDuplicate) return;
205
+ const name$2 = node.name;
206
+ const initialScope = context.sourceCode.getScope(node);
207
+ if (!isFromReact(node, importSource, initialScope)) return;
208
+ context.report({
209
+ messageId: "isFromReact",
210
+ node,
211
+ data: { json: stringify({
212
+ name: name$2,
213
+ importSource
214
+ }) }
215
+ });
216
+ }
217
+ return {
218
+ Identifier: visitorFunction,
219
+ JSXIdentifier: visitorFunction
220
+ };
241
221
  }
222
+ /**
223
+ * Check if an identifier node is initialized from React
224
+ * @param node The identifier node to check
225
+ * @param importSource The import source to check against
226
+ * @param initialScope Initial scope to search for the identifier
227
+ * @returns Whether the identifier node is initialized from React
228
+ */
242
229
  function isFromReact(node, importSource, initialScope) {
243
- const name3 = node.name;
244
- switch (true) {
245
- case (node.parent.type === utils.AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === utils.AST_NODE_TYPES.Identifier):
246
- return ER2__namespace.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
247
- case (node.parent.type === utils.AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === utils.AST_NODE_TYPES.JSXIdentifier):
248
- return ER2__namespace.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
249
- default:
250
- return ER2__namespace.isInitializedFromReact(name3, importSource, initialScope);
251
- }
230
+ const name$2 = node.name;
231
+ switch (true) {
232
+ case node.parent.type === __typescript_eslint_utils.AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier: return __eslint_react_core.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
233
+ case node.parent.type === __typescript_eslint_utils.AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === __typescript_eslint_utils.AST_NODE_TYPES.JSXIdentifier: return __eslint_react_core.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
234
+ default: return __eslint_react_core.isInitializedFromReact(name$2, importSource, initialScope);
235
+ }
252
236
  }
253
- var { JsxEmit } = kit.JsxConfig;
254
- var RULE_NAME5 = "jsx";
255
- var RULE_FEATURES5 = [
256
- "DBG"
257
- ];
237
+
238
+ //#endregion
239
+ //#region src/rules/jsx.ts
240
+ const { JsxEmit } = __eslint_react_kit.JsxConfig;
241
+ const RULE_NAME = "jsx";
242
+ const RULE_FEATURES = ["DBG"];
258
243
  var jsx_default = createRule({
259
- meta: {
260
- type: "problem",
261
- docs: {
262
- description: "Reports all JSX elements and fragments.",
263
- [Symbol.for("rule_features")]: RULE_FEATURES5
264
- },
265
- messages: {
266
- jsx: "{{json}}"
267
- },
268
- schema: []
269
- },
270
- name: RULE_NAME5,
271
- create: create5,
272
- defaultOptions: []
244
+ meta: {
245
+ type: "problem",
246
+ docs: {
247
+ description: "Reports all JSX elements and fragments.",
248
+ [Symbol.for("rule_features")]: RULE_FEATURES
249
+ },
250
+ messages: { jsx: "{{json}}" },
251
+ schema: []
252
+ },
253
+ name: RULE_NAME,
254
+ create,
255
+ defaultOptions: []
273
256
  });
274
- function create5(context) {
275
- const jsxConfigFromContext = kit.JsxConfig.getFromContext(context);
276
- const jsxConfigFromAnnotation = kit.JsxConfig.getFromAnnotation(context);
277
- const jsxConfig = {
278
- ...jsxConfigFromContext,
279
- ...jsxConfigFromAnnotation
280
- };
281
- function getReportDescriptor(context2) {
282
- return (node) => ({
283
- messageId: "jsx",
284
- node,
285
- data: {
286
- json: stringify({
287
- kind: tsPattern.match(node).with({ type: types.AST_NODE_TYPES.JSXElement }, (n) => ER2__namespace.isFragmentElement(context2, n) ? "fragment" : "element").with({ type: types.AST_NODE_TYPES.JSXFragment }, () => "fragment").exhaustive(),
288
- type: ER2__namespace.getElementType(context2, node),
289
- jsx: tsPattern.match(jsxConfig.jsx).with(JsxEmit.None, () => "none").with(JsxEmit.ReactJSX, () => "react-jsx").with(JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(JsxEmit.React, () => "react").with(JsxEmit.ReactNative, () => "react-native").with(JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
290
- jsxFactory: jsxConfig.jsxFactory,
291
- jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
292
- jsxImportSource: jsxConfig.jsxImportSource,
293
- jsxRuntime: tsPattern.match(jsxConfig.jsx).with(tsPattern.P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
294
- })
295
- }
296
- });
297
- }
298
- return {
299
- "JSXElement, JSXFragment": eff.flow(getReportDescriptor(context), kit.Reporter.make(context).send)
300
- };
257
+ function create(context) {
258
+ const jsxConfigFromContext = __eslint_react_kit.JsxConfig.getFromContext(context);
259
+ const jsxConfigFromAnnotation = __eslint_react_kit.JsxConfig.getFromAnnotation(context);
260
+ const jsxConfig = {
261
+ ...jsxConfigFromContext,
262
+ ...jsxConfigFromAnnotation
263
+ };
264
+ function getReportDescriptor(context$1) {
265
+ return (node) => ({
266
+ messageId: "jsx",
267
+ node,
268
+ data: { json: stringify({
269
+ kind: (0, ts_pattern.match)(node).with({ type: __typescript_eslint_types.AST_NODE_TYPES.JSXElement }, (n) => __eslint_react_core.isFragmentElement(context$1, n) ? "fragment" : "element").with({ type: __typescript_eslint_types.AST_NODE_TYPES.JSXFragment }, () => "fragment").exhaustive(),
270
+ type: __eslint_react_core.getElementType(context$1, node),
271
+ jsx: (0, ts_pattern.match)(jsxConfig.jsx).with(JsxEmit.None, () => "none").with(JsxEmit.ReactJSX, () => "react-jsx").with(JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(JsxEmit.React, () => "react").with(JsxEmit.ReactNative, () => "react-native").with(JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
272
+ jsxFactory: jsxConfig.jsxFactory,
273
+ jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
274
+ jsxImportSource: jsxConfig.jsxImportSource,
275
+ jsxRuntime: (0, ts_pattern.match)(jsxConfig.jsx).with(ts_pattern.P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
276
+ }) }
277
+ });
278
+ }
279
+ return { "JSXElement, JSXFragment": (0, __eslint_react_eff.flow)(getReportDescriptor(context), __eslint_react_kit.Reporter.make(context).send) };
301
280
  }
302
281
 
303
- // src/plugin.ts
304
- var plugin = {
305
- meta: {
306
- name: name2,
307
- version
308
- },
309
- rules: {
310
- ["class-component"]: class_component_default,
311
- ["function-component"]: function_component_default,
312
- ["hook"]: hook_default,
313
- ["is-from-react"]: is_from_react_default,
314
- ["jsx"]: jsx_default,
315
- // Part: deprecated rules
316
- /** @deprecated Use `hook` instead */
317
- "react-hooks": hook_default
318
- }
282
+ //#endregion
283
+ //#region src/plugin.ts
284
+ const plugin = {
285
+ meta: {
286
+ name,
287
+ version
288
+ },
289
+ rules: {
290
+ ["class-component"]: class_component_default,
291
+ ["function-component"]: function_component_default,
292
+ ["hook"]: hook_default,
293
+ ["is-from-react"]: is_from_react_default,
294
+ ["jsx"]: jsx_default,
295
+ "react-hooks": hook_default
296
+ }
319
297
  };
320
298
 
321
- // src/index.ts
322
- var { toFlatConfig, toLegacyConfig } = shared.getConfigAdapters("react-debug", plugin);
323
- var index_default = {
324
- ...plugin,
325
- configs: {
326
- ["all"]: toFlatConfig(all_exports),
327
- ["all-legacy"]: toLegacyConfig(all_exports)
328
- }
299
+ //#endregion
300
+ //#region src/index.ts
301
+ const { toFlatConfig, toLegacyConfig } = (0, __eslint_react_shared.getConfigAdapters)("react-debug", plugin);
302
+ var src_default = {
303
+ ...plugin,
304
+ configs: {
305
+ ["all"]: toFlatConfig(all_exports),
306
+ ["all-legacy"]: toLegacyConfig(all_exports)
307
+ }
329
308
  };
330
309
 
331
- module.exports = index_default;
310
+ //#endregion
311
+ module.exports = src_default;
package/dist/index.mjs CHANGED
@@ -1,309 +1,292 @@
1
- import { getDocsUrl, getSettingsFromContext, getConfigAdapters, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
2
- import * as ER2 from '@eslint-react/core';
3
- import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
4
- import { flow } from '@eslint-react/eff';
5
- import { JsxConfig, Reporter } from '@eslint-react/kit';
6
- import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from '@typescript-eslint/types';
7
- import { match, P } from 'ts-pattern';
1
+ import { DEFAULT_ESLINT_REACT_SETTINGS, getConfigAdapters, getDocsUrl, getSettingsFromContext } from "@eslint-react/shared";
2
+ import * as ER from "@eslint-react/core";
3
+ import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
4
+ import { flow } from "@eslint-react/eff";
5
+ import { JsxConfig, Reporter } from "@eslint-react/kit";
6
+ import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from "@typescript-eslint/types";
7
+ import { P, match } from "ts-pattern";
8
8
 
9
+ //#region rolldown:runtime
9
10
  var __defProp = Object.defineProperty;
10
11
  var __export = (target, all) => {
11
- for (var name3 in all)
12
- __defProp(target, name3, { get: all[name3], enumerable: true });
12
+ for (var name$2 in all) __defProp(target, name$2, {
13
+ get: all[name$2],
14
+ enumerable: true
15
+ });
13
16
  };
14
17
 
15
- // src/configs/all.ts
18
+ //#endregion
19
+ //#region src/configs/all.ts
16
20
  var all_exports = {};
17
21
  __export(all_exports, {
18
- name: () => name,
19
- rules: () => rules,
20
- settings: () => settings
22
+ name: () => name$1,
23
+ rules: () => rules,
24
+ settings: () => settings
21
25
  });
22
- var name = "react-debug/all";
23
- var rules = {
24
- "react-debug/class-component": "warn",
25
- "react-debug/function-component": "warn",
26
- "react-debug/hook": "warn",
27
- "react-debug/is-from-react": "warn",
28
- "react-debug/jsx": "warn"
29
- };
30
- var settings = {
31
- "react-x": DEFAULT_ESLINT_REACT_SETTINGS
26
+ const name$1 = "react-debug/all";
27
+ const rules = {
28
+ "react-debug/class-component": "warn",
29
+ "react-debug/function-component": "warn",
30
+ "react-debug/hook": "warn",
31
+ "react-debug/is-from-react": "warn",
32
+ "react-debug/jsx": "warn"
32
33
  };
34
+ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
35
+
36
+ //#endregion
37
+ //#region package.json
38
+ var name = "eslint-plugin-react-debug";
39
+ var version = "1.52.10-next.2";
33
40
 
34
- // package.json
35
- var name2 = "eslint-plugin-react-debug";
36
- var version = "1.52.10-next.0";
37
- var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
41
+ //#endregion
42
+ //#region src/utils/create-rule.ts
43
+ const createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
38
44
 
39
- // src/utils/stringify.ts
45
+ //#endregion
46
+ //#region src/utils/stringify.ts
40
47
  function stringify(value) {
41
- return JSON.stringify(value, null, 2);
48
+ return JSON.stringify(value, null, 2);
42
49
  }
43
50
 
44
- // src/rules/class-component.ts
45
- var RULE_NAME = "class-component";
46
- var RULE_FEATURES = [
47
- "DBG"
48
- ];
51
+ //#endregion
52
+ //#region src/rules/class-component.ts
53
+ const RULE_NAME$4 = "class-component";
54
+ const RULE_FEATURES$4 = ["DBG"];
49
55
  var class_component_default = createRule({
50
- meta: {
51
- type: "problem",
52
- docs: {
53
- description: "Reports all class components.",
54
- [Symbol.for("rule_features")]: RULE_FEATURES
55
- },
56
- messages: {
57
- classComponent: "{{json}}"
58
- },
59
- schema: []
60
- },
61
- name: RULE_NAME,
62
- create,
63
- defaultOptions: []
56
+ meta: {
57
+ type: "problem",
58
+ docs: {
59
+ description: "Reports all class components.",
60
+ [Symbol.for("rule_features")]: RULE_FEATURES$4
61
+ },
62
+ messages: { classComponent: "{{json}}" },
63
+ schema: []
64
+ },
65
+ name: RULE_NAME$4,
66
+ create: create$4,
67
+ defaultOptions: []
64
68
  });
65
- function create(context) {
66
- const { ctx, listeners } = ER2.useComponentCollectorLegacy();
67
- return {
68
- ...listeners,
69
- "Program:exit"(program) {
70
- const components = ctx.getAllComponents(program);
71
- for (const { name: name3 = "anonymous", node: component } of components.values()) {
72
- context.report({
73
- messageId: "classComponent",
74
- node: component,
75
- data: {
76
- json: stringify({ name: name3 })
77
- }
78
- });
79
- }
80
- }
81
- };
69
+ function create$4(context) {
70
+ const { ctx, listeners } = ER.useComponentCollectorLegacy();
71
+ return {
72
+ ...listeners,
73
+ "Program:exit"(program) {
74
+ const components = ctx.getAllComponents(program);
75
+ for (const { name: name$2 = "anonymous", node: component } of components.values()) context.report({
76
+ messageId: "classComponent",
77
+ node: component,
78
+ data: { json: stringify({ name: name$2 }) }
79
+ });
80
+ }
81
+ };
82
82
  }
83
- var RULE_NAME2 = "function-component";
84
- var RULE_FEATURES2 = [
85
- "DBG"
86
- ];
83
+
84
+ //#endregion
85
+ //#region src/rules/function-component.ts
86
+ const RULE_NAME$3 = "function-component";
87
+ const RULE_FEATURES$3 = ["DBG"];
87
88
  var function_component_default = createRule({
88
- meta: {
89
- type: "problem",
90
- docs: {
91
- description: "Reports all function components.",
92
- [Symbol.for("rule_features")]: RULE_FEATURES2
93
- },
94
- messages: {
95
- functionComponent: "{{json}}"
96
- // "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}, displayName: {{displayName}}.",
97
- },
98
- schema: []
99
- },
100
- name: RULE_NAME2,
101
- create: create2,
102
- defaultOptions: []
89
+ meta: {
90
+ type: "problem",
91
+ docs: {
92
+ description: "Reports all function components.",
93
+ [Symbol.for("rule_features")]: RULE_FEATURES$3
94
+ },
95
+ messages: { functionComponent: "{{json}}" },
96
+ schema: []
97
+ },
98
+ name: RULE_NAME$3,
99
+ create: create$3,
100
+ defaultOptions: []
103
101
  });
104
- function create2(context) {
105
- const { ctx, listeners } = ER2.useComponentCollector(
106
- context,
107
- {
108
- collectDisplayName: true,
109
- collectHookCalls: true,
110
- hint: ER2.DEFAULT_COMPONENT_DETECTION_HINT
111
- }
112
- );
113
- return {
114
- ...listeners,
115
- "Program:exit"(program) {
116
- const components = ctx.getAllComponents(program);
117
- for (const { name: name3 = "anonymous", node, displayName, flag, hookCalls } of components.values()) {
118
- context.report({
119
- messageId: "functionComponent",
120
- node,
121
- data: {
122
- json: stringify({
123
- name: name3,
124
- displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
125
- forwardRef: (flag & ER2.ComponentFlag.ForwardRef) > 0n,
126
- hookCalls: hookCalls.length,
127
- memo: (flag & ER2.ComponentFlag.Memo) > 0n
128
- })
129
- }
130
- });
131
- }
132
- }
133
- };
102
+ function create$3(context) {
103
+ const { ctx, listeners } = ER.useComponentCollector(context, {
104
+ collectDisplayName: true,
105
+ collectHookCalls: true,
106
+ hint: ER.DEFAULT_COMPONENT_DETECTION_HINT
107
+ });
108
+ return {
109
+ ...listeners,
110
+ "Program:exit"(program) {
111
+ const components = ctx.getAllComponents(program);
112
+ for (const { name: name$2 = "anonymous", node, displayName, flag, hookCalls } of components.values()) context.report({
113
+ messageId: "functionComponent",
114
+ node,
115
+ data: { json: stringify({
116
+ name: name$2,
117
+ displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
118
+ forwardRef: (flag & ER.ComponentFlag.ForwardRef) > 0n,
119
+ hookCalls: hookCalls.length,
120
+ memo: (flag & ER.ComponentFlag.Memo) > 0n
121
+ }) }
122
+ });
123
+ }
124
+ };
134
125
  }
135
- var RULE_NAME3 = "hook";
136
- var RULE_FEATURES3 = [
137
- "DBG"
138
- ];
126
+
127
+ //#endregion
128
+ //#region src/rules/hook.ts
129
+ const RULE_NAME$2 = "hook";
130
+ const RULE_FEATURES$2 = ["DBG"];
139
131
  var hook_default = createRule({
140
- meta: {
141
- type: "problem",
142
- docs: {
143
- description: "Reports all React Hooks.",
144
- [Symbol.for("rule_features")]: RULE_FEATURES3
145
- },
146
- messages: {
147
- hook: "{{json}}"
148
- },
149
- schema: []
150
- },
151
- name: RULE_NAME3,
152
- create: create3,
153
- defaultOptions: []
132
+ meta: {
133
+ type: "problem",
134
+ docs: {
135
+ description: "Reports all React Hooks.",
136
+ [Symbol.for("rule_features")]: RULE_FEATURES$2
137
+ },
138
+ messages: { hook: "{{json}}" },
139
+ schema: []
140
+ },
141
+ name: RULE_NAME$2,
142
+ create: create$2,
143
+ defaultOptions: []
154
144
  });
155
- function create3(context) {
156
- const { ctx, listeners } = ER2.useHookCollector();
157
- return {
158
- ...listeners,
159
- "Program:exit"(program) {
160
- const allHooks = ctx.getAllHooks(program);
161
- for (const { name: name3, node, hookCalls } of allHooks.values()) {
162
- context.report({
163
- messageId: "hook",
164
- node,
165
- data: {
166
- json: stringify({
167
- name: name3,
168
- hookCalls: hookCalls.length
169
- })
170
- }
171
- });
172
- }
173
- }
174
- };
145
+ function create$2(context) {
146
+ const { ctx, listeners } = ER.useHookCollector();
147
+ return {
148
+ ...listeners,
149
+ "Program:exit"(program) {
150
+ const allHooks = ctx.getAllHooks(program);
151
+ for (const { name: name$2, node, hookCalls } of allHooks.values()) context.report({
152
+ messageId: "hook",
153
+ node,
154
+ data: { json: stringify({
155
+ name: name$2,
156
+ hookCalls: hookCalls.length
157
+ }) }
158
+ });
159
+ }
160
+ };
175
161
  }
176
- var RULE_NAME4 = "is-from-react";
177
- var RULE_FEATURES4 = [
178
- "DBG"
179
- ];
162
+
163
+ //#endregion
164
+ //#region src/rules/is-from-react.ts
165
+ const RULE_NAME$1 = "is-from-react";
166
+ const RULE_FEATURES$1 = ["DBG"];
180
167
  var is_from_react_default = createRule({
181
- meta: {
182
- type: "problem",
183
- docs: {
184
- description: "Reports all identifiers that are initialized from React.",
185
- [Symbol.for("rule_features")]: RULE_FEATURES4
186
- },
187
- messages: {
188
- isFromReact: "{{json}}"
189
- },
190
- schema: []
191
- },
192
- name: RULE_NAME4,
193
- create: create4,
194
- defaultOptions: []
168
+ meta: {
169
+ type: "problem",
170
+ docs: {
171
+ description: "Reports all identifiers that are initialized from React.",
172
+ [Symbol.for("rule_features")]: RULE_FEATURES$1
173
+ },
174
+ messages: { isFromReact: "{{json}}" },
175
+ schema: []
176
+ },
177
+ name: RULE_NAME$1,
178
+ create: create$1,
179
+ defaultOptions: []
195
180
  });
196
- function create4(context) {
197
- const { importSource = "react" } = getSettingsFromContext(context);
198
- function visitorFunction(node) {
199
- const shouldSkipDuplicate = node.parent.type === AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name;
200
- if (shouldSkipDuplicate) return;
201
- const name3 = node.name;
202
- const initialScope = context.sourceCode.getScope(node);
203
- if (!isFromReact(node, importSource, initialScope)) return;
204
- context.report({
205
- messageId: "isFromReact",
206
- node,
207
- data: {
208
- json: stringify({
209
- name: name3,
210
- importSource
211
- })
212
- }
213
- });
214
- }
215
- return {
216
- Identifier: visitorFunction,
217
- JSXIdentifier: visitorFunction
218
- };
181
+ function create$1(context) {
182
+ const { importSource = "react" } = getSettingsFromContext(context);
183
+ function visitorFunction(node) {
184
+ const shouldSkipDuplicate = node.parent.type === AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name;
185
+ if (shouldSkipDuplicate) return;
186
+ const name$2 = node.name;
187
+ const initialScope = context.sourceCode.getScope(node);
188
+ if (!isFromReact(node, importSource, initialScope)) return;
189
+ context.report({
190
+ messageId: "isFromReact",
191
+ node,
192
+ data: { json: stringify({
193
+ name: name$2,
194
+ importSource
195
+ }) }
196
+ });
197
+ }
198
+ return {
199
+ Identifier: visitorFunction,
200
+ JSXIdentifier: visitorFunction
201
+ };
219
202
  }
203
+ /**
204
+ * Check if an identifier node is initialized from React
205
+ * @param node The identifier node to check
206
+ * @param importSource The import source to check against
207
+ * @param initialScope Initial scope to search for the identifier
208
+ * @returns Whether the identifier node is initialized from React
209
+ */
220
210
  function isFromReact(node, importSource, initialScope) {
221
- const name3 = node.name;
222
- switch (true) {
223
- case (node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier):
224
- return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
225
- case (node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier):
226
- return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
227
- default:
228
- return ER2.isInitializedFromReact(name3, importSource, initialScope);
229
- }
211
+ const name$2 = node.name;
212
+ switch (true) {
213
+ case node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier: return ER.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
214
+ case node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier: return ER.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
215
+ default: return ER.isInitializedFromReact(name$2, importSource, initialScope);
216
+ }
230
217
  }
231
- var { JsxEmit } = JsxConfig;
232
- var RULE_NAME5 = "jsx";
233
- var RULE_FEATURES5 = [
234
- "DBG"
235
- ];
218
+
219
+ //#endregion
220
+ //#region src/rules/jsx.ts
221
+ const { JsxEmit } = JsxConfig;
222
+ const RULE_NAME = "jsx";
223
+ const RULE_FEATURES = ["DBG"];
236
224
  var jsx_default = createRule({
237
- meta: {
238
- type: "problem",
239
- docs: {
240
- description: "Reports all JSX elements and fragments.",
241
- [Symbol.for("rule_features")]: RULE_FEATURES5
242
- },
243
- messages: {
244
- jsx: "{{json}}"
245
- },
246
- schema: []
247
- },
248
- name: RULE_NAME5,
249
- create: create5,
250
- defaultOptions: []
225
+ meta: {
226
+ type: "problem",
227
+ docs: {
228
+ description: "Reports all JSX elements and fragments.",
229
+ [Symbol.for("rule_features")]: RULE_FEATURES
230
+ },
231
+ messages: { jsx: "{{json}}" },
232
+ schema: []
233
+ },
234
+ name: RULE_NAME,
235
+ create,
236
+ defaultOptions: []
251
237
  });
252
- function create5(context) {
253
- const jsxConfigFromContext = JsxConfig.getFromContext(context);
254
- const jsxConfigFromAnnotation = JsxConfig.getFromAnnotation(context);
255
- const jsxConfig = {
256
- ...jsxConfigFromContext,
257
- ...jsxConfigFromAnnotation
258
- };
259
- function getReportDescriptor(context2) {
260
- return (node) => ({
261
- messageId: "jsx",
262
- node,
263
- data: {
264
- json: stringify({
265
- kind: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => ER2.isFragmentElement(context2, n) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
266
- type: ER2.getElementType(context2, node),
267
- jsx: match(jsxConfig.jsx).with(JsxEmit.None, () => "none").with(JsxEmit.ReactJSX, () => "react-jsx").with(JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(JsxEmit.React, () => "react").with(JsxEmit.ReactNative, () => "react-native").with(JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
268
- jsxFactory: jsxConfig.jsxFactory,
269
- jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
270
- jsxImportSource: jsxConfig.jsxImportSource,
271
- jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
272
- })
273
- }
274
- });
275
- }
276
- return {
277
- "JSXElement, JSXFragment": flow(getReportDescriptor(context), Reporter.make(context).send)
278
- };
238
+ function create(context) {
239
+ const jsxConfigFromContext = JsxConfig.getFromContext(context);
240
+ const jsxConfigFromAnnotation = JsxConfig.getFromAnnotation(context);
241
+ const jsxConfig = {
242
+ ...jsxConfigFromContext,
243
+ ...jsxConfigFromAnnotation
244
+ };
245
+ function getReportDescriptor(context$1) {
246
+ return (node) => ({
247
+ messageId: "jsx",
248
+ node,
249
+ data: { json: stringify({
250
+ kind: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => ER.isFragmentElement(context$1, n) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
251
+ type: ER.getElementType(context$1, node),
252
+ jsx: match(jsxConfig.jsx).with(JsxEmit.None, () => "none").with(JsxEmit.ReactJSX, () => "react-jsx").with(JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(JsxEmit.React, () => "react").with(JsxEmit.ReactNative, () => "react-native").with(JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
253
+ jsxFactory: jsxConfig.jsxFactory,
254
+ jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
255
+ jsxImportSource: jsxConfig.jsxImportSource,
256
+ jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
257
+ }) }
258
+ });
259
+ }
260
+ return { "JSXElement, JSXFragment": flow(getReportDescriptor(context), Reporter.make(context).send) };
279
261
  }
280
262
 
281
- // src/plugin.ts
282
- var plugin = {
283
- meta: {
284
- name: name2,
285
- version
286
- },
287
- rules: {
288
- ["class-component"]: class_component_default,
289
- ["function-component"]: function_component_default,
290
- ["hook"]: hook_default,
291
- ["is-from-react"]: is_from_react_default,
292
- ["jsx"]: jsx_default,
293
- // Part: deprecated rules
294
- /** @deprecated Use `hook` instead */
295
- "react-hooks": hook_default
296
- }
263
+ //#endregion
264
+ //#region src/plugin.ts
265
+ const plugin = {
266
+ meta: {
267
+ name,
268
+ version
269
+ },
270
+ rules: {
271
+ ["class-component"]: class_component_default,
272
+ ["function-component"]: function_component_default,
273
+ ["hook"]: hook_default,
274
+ ["is-from-react"]: is_from_react_default,
275
+ ["jsx"]: jsx_default,
276
+ "react-hooks": hook_default
277
+ }
297
278
  };
298
279
 
299
- // src/index.ts
300
- var { toFlatConfig, toLegacyConfig } = getConfigAdapters("react-debug", plugin);
301
- var index_default = {
302
- ...plugin,
303
- configs: {
304
- ["all"]: toFlatConfig(all_exports),
305
- ["all-legacy"]: toLegacyConfig(all_exports)
306
- }
280
+ //#endregion
281
+ //#region src/index.ts
282
+ const { toFlatConfig, toLegacyConfig } = getConfigAdapters("react-debug", plugin);
283
+ var src_default = {
284
+ ...plugin,
285
+ configs: {
286
+ ["all"]: toFlatConfig(all_exports),
287
+ ["all-legacy"]: toLegacyConfig(all_exports)
288
+ }
307
289
  };
308
290
 
309
- export { index_default as default };
291
+ //#endregion
292
+ export { src_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "1.52.10-next.0",
3
+ "version": "1.52.10-next.2",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -43,23 +43,23 @@
43
43
  "./package.json"
44
44
  ],
45
45
  "dependencies": {
46
- "@typescript-eslint/scope-manager": "^8.41.0",
47
- "@typescript-eslint/type-utils": "^8.41.0",
48
- "@typescript-eslint/types": "^8.41.0",
49
- "@typescript-eslint/utils": "^8.41.0",
46
+ "@typescript-eslint/scope-manager": "^8.42.0",
47
+ "@typescript-eslint/type-utils": "^8.42.0",
48
+ "@typescript-eslint/types": "^8.42.0",
49
+ "@typescript-eslint/utils": "^8.42.0",
50
50
  "string-ts": "^2.2.1",
51
51
  "ts-pattern": "^5.8.0",
52
- "@eslint-react/ast": "1.52.10-next.0",
53
- "@eslint-react/eff": "1.52.10-next.0",
54
- "@eslint-react/core": "1.52.10-next.0",
55
- "@eslint-react/kit": "1.52.10-next.0",
56
- "@eslint-react/shared": "1.52.10-next.0",
57
- "@eslint-react/var": "1.52.10-next.0"
52
+ "@eslint-react/core": "1.52.10-next.2",
53
+ "@eslint-react/eff": "1.52.10-next.2",
54
+ "@eslint-react/ast": "1.52.10-next.2",
55
+ "@eslint-react/var": "1.52.10-next.2",
56
+ "@eslint-react/shared": "1.52.10-next.2",
57
+ "@eslint-react/kit": "1.52.10-next.2"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/react": "^19.1.12",
61
61
  "@types/react-dom": "^19.1.9",
62
- "tsup": "^8.5.0",
62
+ "tsdown": "^0.14.2",
63
63
  "@local/configs": "0.0.0"
64
64
  },
65
65
  "peerDependencies": {
@@ -81,7 +81,7 @@
81
81
  "access": "public"
82
82
  },
83
83
  "scripts": {
84
- "build": "tsup",
84
+ "build": "tsdown",
85
85
  "lint:publish": "publint",
86
86
  "lint:ts": "tsc --noEmit"
87
87
  }