eslint-plugin-react-debug 1.45.4-next.5 → 1.46.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ var settings = {
58
58
 
59
59
  // package.json
60
60
  var name2 = "eslint-plugin-react-debug";
61
- var version = "1.45.4-next.5";
61
+ var version = "1.46.0-beta.0";
62
62
  var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
63
63
 
64
64
  // src/rules/class-component.ts
@@ -74,7 +74,7 @@ var class_component_default = createRule({
74
74
  [Symbol.for("rule_features")]: RULE_FEATURES
75
75
  },
76
76
  messages: {
77
- classComponent: "[class component] name: {{name}}."
77
+ classComponent: "{{json}}"
78
78
  },
79
79
  schema: []
80
80
  },
@@ -93,7 +93,7 @@ function create(context) {
93
93
  messageId: "classComponent",
94
94
  node: component,
95
95
  data: {
96
- name: name3
96
+ json: JSON.stringify({ name: name3 })
97
97
  }
98
98
  });
99
99
  }
@@ -112,7 +112,8 @@ var function_component_default = createRule({
112
112
  [Symbol.for("rule_features")]: RULE_FEATURES2
113
113
  },
114
114
  messages: {
115
- functionComponent: "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}, displayName: {{displayName}}."
115
+ functionComponent: "{{json}}"
116
+ // "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}, displayName: {{displayName}}.",
116
117
  },
117
118
  schema: []
118
119
  },
@@ -138,11 +139,13 @@ function create2(context) {
138
139
  messageId: "functionComponent",
139
140
  node,
140
141
  data: {
141
- name: name3,
142
- displayName: displayName != null ? context.sourceCode.getText(displayName) : "none",
143
- forwardRef: (flag & ER2__namespace.ComponentFlag.ForwardRef) > 0n,
144
- hookCalls: hookCalls.length,
145
- memo: (flag & ER2__namespace.ComponentFlag.Memo) > 0n
142
+ json: JSON.stringify({
143
+ name: name3,
144
+ displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
145
+ forwardRef: (flag & ER2__namespace.ComponentFlag.ForwardRef) > 0n,
146
+ hookCalls: hookCalls.length,
147
+ memo: (flag & ER2__namespace.ComponentFlag.Memo) > 0n
148
+ })
146
149
  }
147
150
  });
148
151
  }
@@ -161,7 +164,7 @@ var hook_default = createRule({
161
164
  [Symbol.for("rule_features")]: RULE_FEATURES3
162
165
  },
163
166
  messages: {
164
- hook: "[hook] name: {{name}}, hookCalls: {{hookCalls}}."
167
+ hook: "{{json}}"
165
168
  },
166
169
  schema: []
167
170
  },
@@ -180,8 +183,10 @@ function create3(context) {
180
183
  messageId: "hook",
181
184
  node,
182
185
  data: {
183
- name: name3,
184
- hookCalls: hookCalls.length
186
+ json: JSON.stringify({
187
+ name: name3,
188
+ hookCalls: hookCalls.length
189
+ })
185
190
  }
186
191
  });
187
192
  }
@@ -196,11 +201,11 @@ var is_from_react_default = createRule({
196
201
  meta: {
197
202
  type: "problem",
198
203
  docs: {
199
- description: "Report all identifiers that are initialized from React.",
204
+ description: "Reports all identifiers that are initialized from React.",
200
205
  [Symbol.for("rule_features")]: RULE_FEATURES4
201
206
  },
202
207
  messages: {
203
- isFromReact: "[initialized from react] name: '{{name}}', import source: '{{importSource}}'."
208
+ isFromReact: "{{json}}"
204
209
  },
205
210
  schema: []
206
211
  },
@@ -231,9 +236,10 @@ function create4(context) {
231
236
  messageId: "isFromReact",
232
237
  node,
233
238
  data: {
234
- type: node.type,
235
- name: name3,
236
- importSource
239
+ json: JSON.stringify({
240
+ name: name3,
241
+ importSource
242
+ })
237
243
  }
238
244
  });
239
245
  }
@@ -254,7 +260,7 @@ var jsx_default = createRule({
254
260
  [Symbol.for("rule_features")]: RULE_FEATURES5
255
261
  },
256
262
  messages: {
257
- jsx: "[jsx {{type}}] jsx: '{{jsx}}', jsxFactory: '{{jsxFactory}}', jsxFragmentFactory: '{{jsxFragmentFactory}}', jsxRuntime: '{{jsxRuntime}}' jsxImportSource: '{{jsxImportSource}}'"
263
+ jsx: "{{json}}"
258
264
  },
259
265
  schema: []
260
266
  },
@@ -274,12 +280,14 @@ function create5(context) {
274
280
  messageId: "jsx",
275
281
  node,
276
282
  data: {
277
- type: tsPattern.match(node).with({ type: types.AST_NODE_TYPES.JSXElement }, (n) => JSX__namespace.isFragmentElement(n) ? "fragment" : "element").with({ type: types.AST_NODE_TYPES.JSXFragment }, () => "fragment").exhaustive(),
278
- jsx: tsPattern.match(jsxConfig.jsx).with(typescript.JsxEmit.None, () => "none").with(typescript.JsxEmit.ReactJSX, () => "react-jsx").with(typescript.JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(typescript.JsxEmit.React, () => "react").with(typescript.JsxEmit.ReactNative, () => "react-native").with(typescript.JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
279
- jsxFactory: jsxConfig.jsxFactory,
280
- jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
281
- jsxImportSource: jsxConfig.jsxImportSource,
282
- jsxRuntime: tsPattern.match(jsxConfig.jsx).with(tsPattern.P.union(typescript.JsxEmit.None, typescript.JsxEmit.ReactJSX, typescript.JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
283
+ json: JSON.stringify({
284
+ type: tsPattern.match(node).with({ type: types.AST_NODE_TYPES.JSXElement }, (n) => JSX__namespace.isFragmentElement(n) ? "fragment" : "element").with({ type: types.AST_NODE_TYPES.JSXFragment }, () => "fragment").exhaustive(),
285
+ jsx: tsPattern.match(jsxConfig.jsx).with(typescript.JsxEmit.None, () => "none").with(typescript.JsxEmit.ReactJSX, () => "react-jsx").with(typescript.JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(typescript.JsxEmit.React, () => "react").with(typescript.JsxEmit.ReactNative, () => "react-native").with(typescript.JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
286
+ jsxFactory: jsxConfig.jsxFactory,
287
+ jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
288
+ jsxImportSource: jsxConfig.jsxImportSource,
289
+ jsxRuntime: tsPattern.match(jsxConfig.jsx).with(tsPattern.P.union(typescript.JsxEmit.None, typescript.JsxEmit.ReactJSX, typescript.JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
290
+ })
283
291
  }
284
292
  };
285
293
  }
package/dist/index.mjs CHANGED
@@ -35,7 +35,7 @@ var settings = {
35
35
 
36
36
  // package.json
37
37
  var name2 = "eslint-plugin-react-debug";
38
- var version = "1.45.4-next.5";
38
+ var version = "1.46.0-beta.0";
39
39
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
40
40
 
41
41
  // src/rules/class-component.ts
@@ -51,7 +51,7 @@ var class_component_default = createRule({
51
51
  [Symbol.for("rule_features")]: RULE_FEATURES
52
52
  },
53
53
  messages: {
54
- classComponent: "[class component] name: {{name}}."
54
+ classComponent: "{{json}}"
55
55
  },
56
56
  schema: []
57
57
  },
@@ -70,7 +70,7 @@ function create(context) {
70
70
  messageId: "classComponent",
71
71
  node: component,
72
72
  data: {
73
- name: name3
73
+ json: JSON.stringify({ name: name3 })
74
74
  }
75
75
  });
76
76
  }
@@ -89,7 +89,8 @@ var function_component_default = createRule({
89
89
  [Symbol.for("rule_features")]: RULE_FEATURES2
90
90
  },
91
91
  messages: {
92
- functionComponent: "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}, displayName: {{displayName}}."
92
+ functionComponent: "{{json}}"
93
+ // "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}, displayName: {{displayName}}.",
93
94
  },
94
95
  schema: []
95
96
  },
@@ -115,11 +116,13 @@ function create2(context) {
115
116
  messageId: "functionComponent",
116
117
  node,
117
118
  data: {
118
- name: name3,
119
- displayName: displayName != null ? context.sourceCode.getText(displayName) : "none",
120
- forwardRef: (flag & ER2.ComponentFlag.ForwardRef) > 0n,
121
- hookCalls: hookCalls.length,
122
- memo: (flag & ER2.ComponentFlag.Memo) > 0n
119
+ json: JSON.stringify({
120
+ name: name3,
121
+ displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
122
+ forwardRef: (flag & ER2.ComponentFlag.ForwardRef) > 0n,
123
+ hookCalls: hookCalls.length,
124
+ memo: (flag & ER2.ComponentFlag.Memo) > 0n
125
+ })
123
126
  }
124
127
  });
125
128
  }
@@ -138,7 +141,7 @@ var hook_default = createRule({
138
141
  [Symbol.for("rule_features")]: RULE_FEATURES3
139
142
  },
140
143
  messages: {
141
- hook: "[hook] name: {{name}}, hookCalls: {{hookCalls}}."
144
+ hook: "{{json}}"
142
145
  },
143
146
  schema: []
144
147
  },
@@ -157,8 +160,10 @@ function create3(context) {
157
160
  messageId: "hook",
158
161
  node,
159
162
  data: {
160
- name: name3,
161
- hookCalls: hookCalls.length
163
+ json: JSON.stringify({
164
+ name: name3,
165
+ hookCalls: hookCalls.length
166
+ })
162
167
  }
163
168
  });
164
169
  }
@@ -173,11 +178,11 @@ var is_from_react_default = createRule({
173
178
  meta: {
174
179
  type: "problem",
175
180
  docs: {
176
- description: "Report all identifiers that are initialized from React.",
181
+ description: "Reports all identifiers that are initialized from React.",
177
182
  [Symbol.for("rule_features")]: RULE_FEATURES4
178
183
  },
179
184
  messages: {
180
- isFromReact: "[initialized from react] name: '{{name}}', import source: '{{importSource}}'."
185
+ isFromReact: "{{json}}"
181
186
  },
182
187
  schema: []
183
188
  },
@@ -208,9 +213,10 @@ function create4(context) {
208
213
  messageId: "isFromReact",
209
214
  node,
210
215
  data: {
211
- type: node.type,
212
- name: name3,
213
- importSource
216
+ json: JSON.stringify({
217
+ name: name3,
218
+ importSource
219
+ })
214
220
  }
215
221
  });
216
222
  }
@@ -231,7 +237,7 @@ var jsx_default = createRule({
231
237
  [Symbol.for("rule_features")]: RULE_FEATURES5
232
238
  },
233
239
  messages: {
234
- jsx: "[jsx {{type}}] jsx: '{{jsx}}', jsxFactory: '{{jsxFactory}}', jsxFragmentFactory: '{{jsxFragmentFactory}}', jsxRuntime: '{{jsxRuntime}}' jsxImportSource: '{{jsxImportSource}}'"
240
+ jsx: "{{json}}"
235
241
  },
236
242
  schema: []
237
243
  },
@@ -251,12 +257,14 @@ function create5(context) {
251
257
  messageId: "jsx",
252
258
  node,
253
259
  data: {
254
- type: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => JSX.isFragmentElement(n) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
255
- 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"),
256
- jsxFactory: jsxConfig.jsxFactory,
257
- jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
258
- jsxImportSource: jsxConfig.jsxImportSource,
259
- jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
260
+ json: JSON.stringify({
261
+ type: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => JSX.isFragmentElement(n) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
262
+ 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"),
263
+ jsxFactory: jsxConfig.jsxFactory,
264
+ jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
265
+ jsxImportSource: jsxConfig.jsxImportSource,
266
+ jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
267
+ })
260
268
  }
261
269
  };
262
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "1.45.4-next.5",
3
+ "version": "1.46.0-beta.0",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -49,13 +49,13 @@
49
49
  "@typescript-eslint/utils": "^8.29.1",
50
50
  "string-ts": "^2.2.1",
51
51
  "ts-pattern": "^5.7.0",
52
- "@eslint-react/core": "1.45.4-next.5",
53
- "@eslint-react/eff": "1.45.4-next.5",
54
- "@eslint-react/ast": "1.45.4-next.5",
55
- "@eslint-react/kit": "1.45.4-next.5",
56
- "@eslint-react/shared": "1.45.4-next.5",
57
- "@eslint-react/jsx": "1.45.4-next.5",
58
- "@eslint-react/var": "1.45.4-next.5"
52
+ "@eslint-react/ast": "1.46.0-beta.0",
53
+ "@eslint-react/core": "1.46.0-beta.0",
54
+ "@eslint-react/eff": "1.46.0-beta.0",
55
+ "@eslint-react/shared": "1.46.0-beta.0",
56
+ "@eslint-react/var": "1.46.0-beta.0",
57
+ "@eslint-react/kit": "1.46.0-beta.0",
58
+ "@eslint-react/jsx": "1.46.0-beta.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/react": "^19.1.1",