eslint-plugin-react-debug 2.4.0-beta.11 → 2.4.0-beta.13

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 (2) hide show
  1. package/dist/index.js +10 -33
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
41
41
  //#endregion
42
42
  //#region package.json
43
43
  var name = "eslint-plugin-react-debug";
44
- var version = "2.4.0-beta.11";
44
+ var version = "2.4.0-beta.13";
45
45
 
46
46
  //#endregion
47
47
  //#region src/utils/create-rule.ts
@@ -59,14 +59,10 @@ function stringify(value) {
59
59
  //#endregion
60
60
  //#region src/rules/class-component.ts
61
61
  const RULE_NAME$4 = "class-component";
62
- const RULE_FEATURES$4 = ["DBG"];
63
62
  var class_component_default = createRule({
64
63
  meta: {
65
64
  type: "problem",
66
- docs: {
67
- description: "Reports all class components.",
68
- [Symbol.for("rule_features")]: RULE_FEATURES$4
69
- },
65
+ docs: { description: "Reports all class components." },
70
66
  messages: { classComponent: "{{json}}" },
71
67
  schema: []
72
68
  },
@@ -91,14 +87,10 @@ function create$4(context) {
91
87
  //#endregion
92
88
  //#region src/rules/function-component.ts
93
89
  const RULE_NAME$3 = "function-component";
94
- const RULE_FEATURES$3 = ["DBG"];
95
90
  var function_component_default = createRule({
96
91
  meta: {
97
92
  type: "problem",
98
- docs: {
99
- description: "Reports all function components.",
100
- [Symbol.for("rule_features")]: RULE_FEATURES$3
101
- },
93
+ docs: { description: "Reports all function components." },
102
94
  messages: { functionComponent: "{{json}}" },
103
95
  schema: []
104
96
  },
@@ -133,14 +125,10 @@ function create$3(context) {
133
125
  //#endregion
134
126
  //#region src/rules/hook.ts
135
127
  const RULE_NAME$2 = "hook";
136
- const RULE_FEATURES$2 = ["DBG"];
137
128
  var hook_default = createRule({
138
129
  meta: {
139
130
  type: "problem",
140
- docs: {
141
- description: "Reports all React Hooks.",
142
- [Symbol.for("rule_features")]: RULE_FEATURES$2
143
- },
131
+ docs: { description: "Reports all React Hooks." },
144
132
  messages: { hook: "{{json}}" },
145
133
  schema: []
146
134
  },
@@ -168,14 +156,10 @@ function create$2(context) {
168
156
  //#endregion
169
157
  //#region src/rules/is-from-react.ts
170
158
  const RULE_NAME$1 = "is-from-react";
171
- const RULE_FEATURES$1 = ["DBG"];
172
159
  var is_from_react_default = createRule({
173
160
  meta: {
174
161
  type: "problem",
175
- docs: {
176
- description: "Reports all identifiers that are initialized from React.",
177
- [Symbol.for("rule_features")]: RULE_FEATURES$1
178
- },
162
+ docs: { description: "Reports all identifiers that are initialized from React." },
179
163
  messages: { isFromReact: "{{json}}" },
180
164
  schema: []
181
165
  },
@@ -198,10 +182,7 @@ function create$1(context) {
198
182
  }) }
199
183
  });
200
184
  }
201
- return {
202
- Identifier: visitorFunction,
203
- JSXIdentifier: visitorFunction
204
- };
185
+ return Object.fromEntries(["Identifier", "JSXIdentifier"].map((type) => [type, visitorFunction]));
205
186
  }
206
187
  /**
207
188
  * Check if an identifier node is initialized from React
@@ -213,23 +194,19 @@ function create$1(context) {
213
194
  function isFromReact(node, importSource, initialScope) {
214
195
  const name$2 = node.name;
215
196
  switch (true) {
216
- case node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier: return isInitializedFromReact(node.parent.object.name, importSource, initialScope);
217
- case node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier: return isInitializedFromReact(node.parent.object.name, importSource, initialScope);
218
- default: return isInitializedFromReact(name$2, importSource, initialScope);
197
+ case node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier: return isInitializedFromReact(node.parent.object.name, initialScope, importSource);
198
+ case node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier: return isInitializedFromReact(node.parent.object.name, initialScope, importSource);
199
+ default: return isInitializedFromReact(name$2, initialScope, importSource);
219
200
  }
220
201
  }
221
202
 
222
203
  //#endregion
223
204
  //#region src/rules/jsx.ts
224
205
  const RULE_NAME = "jsx";
225
- const RULE_FEATURES = ["DBG"];
226
206
  var jsx_default = createRule({
227
207
  meta: {
228
208
  type: "problem",
229
- docs: {
230
- description: "Reports all JSX elements and fragments.",
231
- [Symbol.for("rule_features")]: RULE_FEATURES
232
- },
209
+ docs: { description: "Reports all JSX elements and fragments." },
233
210
  messages: { jsx: "{{json}}" },
234
211
  schema: []
235
212
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "2.4.0-beta.11",
3
+ "version": "2.4.0-beta.13",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -44,11 +44,11 @@
44
44
  "@typescript-eslint/utils": "^8.50.0",
45
45
  "string-ts": "^2.3.1",
46
46
  "ts-pattern": "^5.9.0",
47
- "@eslint-react/ast": "2.4.0-beta.11",
48
- "@eslint-react/eff": "2.4.0-beta.11",
49
- "@eslint-react/shared": "2.4.0-beta.11",
50
- "@eslint-react/var": "2.4.0-beta.11",
51
- "@eslint-react/core": "2.4.0-beta.11"
47
+ "@eslint-react/ast": "2.4.0-beta.13",
48
+ "@eslint-react/core": "2.4.0-beta.13",
49
+ "@eslint-react/eff": "2.4.0-beta.13",
50
+ "@eslint-react/shared": "2.4.0-beta.13",
51
+ "@eslint-react/var": "2.4.0-beta.13"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/react": "^19.2.7",