eslint-plugin-react-debug 2.7.4-beta.1 → 2.7.4-beta.4
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 +4 -4
- 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.7.4-beta.
|
|
44
|
+
var version = "2.7.4-beta.4";
|
|
45
45
|
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/utils/create-rule.ts
|
|
@@ -163,7 +163,7 @@ function create$1(context) {
|
|
|
163
163
|
function visitorFunction(node) {
|
|
164
164
|
if (node.parent.type === AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name) return;
|
|
165
165
|
const name$2 = node.name;
|
|
166
|
-
if (!isFromReact(node,
|
|
166
|
+
if (!isFromReact(node, context.sourceCode.getScope(node), importSource)) return;
|
|
167
167
|
context.report({
|
|
168
168
|
messageId: "isFromReact",
|
|
169
169
|
node,
|
|
@@ -181,11 +181,11 @@ function create$1(context) {
|
|
|
181
181
|
/**
|
|
182
182
|
* Check if an identifier node is initialized from React
|
|
183
183
|
* @param node The identifier node to check
|
|
184
|
-
* @param importSource The import source to check against
|
|
185
184
|
* @param initialScope Initial scope to search for the identifier
|
|
185
|
+
* @param importSource The import source to check against
|
|
186
186
|
* @returns Whether the identifier node is initialized from React
|
|
187
187
|
*/
|
|
188
|
-
function isFromReact(node,
|
|
188
|
+
function isFromReact(node, initialScope, importSource = "react") {
|
|
189
189
|
const name$2 = node.name;
|
|
190
190
|
switch (true) {
|
|
191
191
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "2.7.4-beta.
|
|
3
|
+
"version": "2.7.4-beta.4",
|
|
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.53.1",
|
|
45
45
|
"string-ts": "^2.3.1",
|
|
46
46
|
"ts-pattern": "^5.9.0",
|
|
47
|
-
"@eslint-react/ast": "2.7.4-beta.
|
|
48
|
-
"@eslint-react/core": "2.7.4-beta.
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
47
|
+
"@eslint-react/ast": "2.7.4-beta.4",
|
|
48
|
+
"@eslint-react/core": "2.7.4-beta.4",
|
|
49
|
+
"@eslint-react/shared": "2.7.4-beta.4",
|
|
50
|
+
"@eslint-react/eff": "2.7.4-beta.4",
|
|
51
|
+
"@eslint-react/var": "2.7.4-beta.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/react": "^19.2.9",
|