eslint-plugin-react-debug 2.0.0-next.58 → 2.0.0-next.61

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +19 -38
  2. package/dist/index.js +257 -285
  3. package/package.json +17 -18
package/dist/index.d.ts CHANGED
@@ -1,43 +1,24 @@
1
- import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
- import { RulePreset } from '@eslint-react/kit';
1
+ import * as _eslint_react_kit0 from "@eslint-react/kit";
3
2
 
3
+ //#region src/index.d.ts
4
4
  declare const _default: {
5
- configs: {
6
- all: {
7
- plugins: {
8
- "react-debug": {
9
- readonly meta: {
10
- readonly name: string;
11
- readonly version: string;
12
- };
13
- readonly rules: {
14
- readonly "class-component": _typescript_eslint_utils_ts_eslint.RuleModule<"classComponent", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
15
- readonly "function-component": _typescript_eslint_utils_ts_eslint.RuleModule<"functionComponent", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
16
- readonly hook: _typescript_eslint_utils_ts_eslint.RuleModule<"hook", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
17
- readonly "is-from-react": _typescript_eslint_utils_ts_eslint.RuleModule<"isFromReact", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
18
- readonly jsx: _typescript_eslint_utils_ts_eslint.RuleModule<"jsx", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
19
- };
20
- };
21
- };
22
- name: string;
23
- rules: RulePreset;
24
- };
25
- "all-legacy": {
26
- plugins: string[];
27
- rules: RulePreset;
28
- };
5
+ configs: {
6
+ all: {
7
+ plugins: {};
8
+ name?: string;
9
+ rules?: Record<string, _eslint_react_kit0.RuleConfig>;
10
+ settings?: _eslint_react_kit0.SettingsConfig;
29
11
  };
30
- meta: {
31
- readonly name: string;
32
- readonly version: string;
33
- };
34
- rules: {
35
- readonly "class-component": _typescript_eslint_utils_ts_eslint.RuleModule<"classComponent", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
36
- readonly "function-component": _typescript_eslint_utils_ts_eslint.RuleModule<"functionComponent", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
37
- readonly hook: _typescript_eslint_utils_ts_eslint.RuleModule<"hook", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
38
- readonly "is-from-react": _typescript_eslint_utils_ts_eslint.RuleModule<"isFromReact", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
39
- readonly jsx: _typescript_eslint_utils_ts_eslint.RuleModule<"jsx", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
12
+ "all-legacy": {
13
+ plugins: string[];
14
+ rules: Record<string, _eslint_react_kit0.RuleConfig<unknown[]>> | undefined;
40
15
  };
16
+ };
17
+ meta: {
18
+ name: string;
19
+ version: string;
20
+ };
21
+ rules: Record<string, _eslint_react_kit0.CompatibleRule>;
41
22
  };
42
-
43
- export { _default as default };
23
+ //#endregion
24
+ export { _default as default };
package/dist/index.js CHANGED
@@ -1,319 +1,291 @@
1
- import { getDocsUrl, getSettingsFromContext, 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 = "2.0.0-next.61";
33
40
 
34
- // package.json
35
- var name2 = "eslint-plugin-react-debug";
36
- var version = "2.0.0-next.58";
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 isFromReact(node, initialScope) {
199
- const name3 = node.name;
200
- switch (true) {
201
- case (node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier):
202
- return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
203
- case (node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier):
204
- return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
205
- default:
206
- return ER2.isInitializedFromReact(name3, importSource, initialScope);
207
- }
208
- }
209
- function visitorFunction(node) {
210
- const shouldSkipDuplicate = node.parent.type === AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name;
211
- if (shouldSkipDuplicate) return;
212
- const name3 = node.name;
213
- const initialScope = context.sourceCode.getScope(node);
214
- if (!isFromReact(node, initialScope)) return;
215
- context.report({
216
- messageId: "isFromReact",
217
- node,
218
- data: {
219
- json: stringify({
220
- name: name3,
221
- importSource
222
- })
223
- }
224
- });
225
- }
226
- return {
227
- Identifier: visitorFunction,
228
- JSXIdentifier: visitorFunction
229
- };
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
+ };
230
202
  }
231
- var { JsxEmit } = JsxConfig;
232
- var RULE_NAME5 = "jsx";
233
- var RULE_FEATURES5 = [
234
- "DBG"
235
- ];
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
+ */
210
+ function isFromReact(node, importSource, initialScope) {
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
+ }
217
+ }
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
- }
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
+ }
294
277
  };
295
278
 
296
- // src/index.ts
297
- function makeConfig(config) {
298
- return {
299
- ...config,
300
- plugins: {
301
- "react-debug": plugin
302
- }
303
- };
304
- }
305
- function makeLegacyConfig({ rules: rules2 }) {
306
- return {
307
- plugins: ["react-debug"],
308
- rules: rules2
309
- };
310
- }
311
- var index_default = {
312
- ...plugin,
313
- configs: {
314
- ["all"]: makeConfig(all_exports),
315
- ["all-legacy"]: makeLegacyConfig(all_exports)
316
- }
279
+ //#endregion
280
+ //#region src/index.ts
281
+ const { toFlatConfig, toLegacyConfig } = getConfigAdapters("react-debug", plugin);
282
+ var src_default = {
283
+ ...plugin,
284
+ configs: {
285
+ ["all"]: toFlatConfig(all_exports),
286
+ ["all-legacy"]: toLegacyConfig(all_exports)
287
+ }
317
288
  };
318
289
 
319
- export { index_default as default };
290
+ //#endregion
291
+ export { src_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "2.0.0-next.58",
3
+ "version": "2.0.0-next.61",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -35,27 +35,27 @@
35
35
  "./package.json"
36
36
  ],
37
37
  "dependencies": {
38
- "@typescript-eslint/scope-manager": "^8.35.0",
39
- "@typescript-eslint/type-utils": "^8.35.0",
40
- "@typescript-eslint/types": "^8.35.0",
41
- "@typescript-eslint/utils": "^8.35.0",
38
+ "@typescript-eslint/scope-manager": "^8.41.0",
39
+ "@typescript-eslint/type-utils": "^8.41.0",
40
+ "@typescript-eslint/types": "^8.41.0",
41
+ "@typescript-eslint/utils": "^8.41.0",
42
42
  "string-ts": "^2.2.1",
43
- "ts-pattern": "^5.7.1",
44
- "@eslint-react/ast": "2.0.0-next.58",
45
- "@eslint-react/core": "2.0.0-next.58",
46
- "@eslint-react/eff": "2.0.0-next.58",
47
- "@eslint-react/shared": "2.0.0-next.58",
48
- "@eslint-react/kit": "2.0.0-next.58",
49
- "@eslint-react/var": "2.0.0-next.58"
43
+ "ts-pattern": "^5.8.0",
44
+ "@eslint-react/core": "2.0.0-next.61",
45
+ "@eslint-react/eff": "2.0.0-next.61",
46
+ "@eslint-react/kit": "2.0.0-next.61",
47
+ "@eslint-react/shared": "2.0.0-next.61",
48
+ "@eslint-react/ast": "2.0.0-next.61",
49
+ "@eslint-react/var": "2.0.0-next.61"
50
50
  },
51
51
  "devDependencies": {
52
- "@types/react": "^19.1.8",
53
- "@types/react-dom": "^19.1.6",
54
- "tsup": "^8.5.0",
52
+ "@types/react": "^19.1.12",
53
+ "@types/react-dom": "^19.1.9",
54
+ "tsdown": "^0.14.2",
55
55
  "@local/configs": "0.0.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "eslint": "^9.29.0",
58
+ "eslint": "^9.34.0",
59
59
  "typescript": "^4.9.5 || ^5.4.5"
60
60
  },
61
61
  "peerDependenciesMeta": {
@@ -67,14 +67,13 @@
67
67
  }
68
68
  },
69
69
  "engines": {
70
- "bun": ">=1.0.15",
71
70
  "node": ">=20.19.0"
72
71
  },
73
72
  "publishConfig": {
74
73
  "access": "public"
75
74
  },
76
75
  "scripts": {
77
- "build": "tsup --dts-resolve",
76
+ "build": "tsdown",
78
77
  "lint:publish": "publint",
79
78
  "lint:ts": "tsc --noEmit"
80
79
  }