@eslint-react/core
Advanced tools
+18
-3
| import * as ast from "@eslint-react/ast"; | ||
| import { constFalse, constTrue, dual, flip, getOrElseUpdate, identity, unit } from "@eslint-react/eff"; | ||
| import { findVariable, getVariableInitializer } from "@eslint-react/var"; | ||
| import { findVariable } from "@eslint-react/var"; | ||
| import { AST_NODE_TYPES } from "@typescript-eslint/types"; | ||
@@ -415,3 +415,11 @@ import { P, match } from "ts-pattern"; | ||
| case AST_NODE_TYPES.Identifier: { | ||
| const initNode = getVariableInitializer(findVariable(attr.argument.name, scope), 0); | ||
| const variable = findVariable(attr.argument.name, scope); | ||
| function resolve(v) { | ||
| if (v == null) return unit; | ||
| const def = v.defs.at(0); | ||
| if (def == null) return unit; | ||
| if ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)) return def.node.init; | ||
| return unit; | ||
| } | ||
| const initNode = resolve(variable); | ||
| if (initNode?.type === AST_NODE_TYPES.ObjectExpression) return ast.findProperty(initNode.properties, name) != null; | ||
@@ -644,3 +652,10 @@ return false; | ||
| if (ast.isJSXTagNameExpression(node)) return true; | ||
| return isJsxLike(code, getVariableInitializer(findVariable(name, code.getScope(node)), 0), hint); | ||
| function resolve(v) { | ||
| if (v == null) return unit; | ||
| const def = v.defs.at(0); | ||
| if (def == null) return unit; | ||
| if ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)) return def.node.init; | ||
| return unit; | ||
| } | ||
| return isJsxLike(code, resolve(findVariable(name, code.getScope(node))), hint); | ||
| } | ||
@@ -647,0 +662,0 @@ } |
+5
-5
| { | ||
| "name": "@eslint-react/core", | ||
| "version": "3.0.0-next.60", | ||
| "version": "3.0.0-next.61", | ||
| "description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.", | ||
@@ -37,6 +37,6 @@ "homepage": "https://github.com/Rel1cx/eslint-react", | ||
| "ts-pattern": "^5.9.0", | ||
| "@eslint-react/ast": "3.0.0-next.60", | ||
| "@eslint-react/eff": "3.0.0-next.60", | ||
| "@eslint-react/shared": "3.0.0-next.60", | ||
| "@eslint-react/var": "3.0.0-next.60" | ||
| "@eslint-react/ast": "3.0.0-next.61", | ||
| "@eslint-react/eff": "3.0.0-next.61", | ||
| "@eslint-react/shared": "3.0.0-next.61", | ||
| "@eslint-react/var": "3.0.0-next.61" | ||
| }, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
91248
0.55%2064
0.73%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed