@eslint-react/var 5.23.5 → 5.24.0-beta.1
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.d.ts +1 -1
- package/dist/index.js +5 -5
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -248,7 +248,7 @@ export type ObjectType = {
|
|
|
248
248
|
* @param node The node to resolve.
|
|
249
249
|
* @returns The object type of the node, or `null` when it cannot be resolved.
|
|
250
250
|
*/
|
|
251
|
-
export declare function resolveObjectType(context: RuleContext, node: TSESTree.Node | null): ObjectType | null;
|
|
251
|
+
export declare function resolveObjectType(context: RuleContext, node: TSESTree.Node | null | undefined): ObjectType | null;
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region src/resolve-origin.d.ts
|
|
254
254
|
/**
|
package/dist/index.js
CHANGED
|
@@ -746,13 +746,13 @@ function isAssignmentTargetEqual(context, a, b) {
|
|
|
746
746
|
* @returns The require expression arguments, or `null` when the node is not a require expression.
|
|
747
747
|
*/
|
|
748
748
|
function getRequireExpressionArguments(node) {
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
751
|
-
const callee = Extract.unwrap(
|
|
752
|
-
if (Check.isIdentifier(callee, "require")) return
|
|
749
|
+
const expr = Extract.unwrap(node);
|
|
750
|
+
if (expr.type === AST_NODE_TYPES.CallExpression) {
|
|
751
|
+
const callee = Extract.unwrap(expr.callee);
|
|
752
|
+
if (Check.isIdentifier(callee, "require")) return expr.arguments;
|
|
753
753
|
return null;
|
|
754
754
|
}
|
|
755
|
-
if (
|
|
755
|
+
if (expr.type === AST_NODE_TYPES.MemberExpression) return getRequireExpressionArguments(expr.object);
|
|
756
756
|
return null;
|
|
757
757
|
}
|
|
758
758
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/var",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0-beta.1",
|
|
4
4
|
"description": "ESLint React's TSESTree AST utility module for static analysis of variables.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint-react/ast": "5.
|
|
33
|
-
"@eslint-react/eslint": "5.
|
|
32
|
+
"@eslint-react/ast": "5.24.0-beta.1",
|
|
33
|
+
"@eslint-react/eslint": "5.24.0-beta.1",
|
|
34
34
|
"@typescript-eslint/scope-manager": "^8.71.0",
|
|
35
35
|
"@typescript-eslint/types": "^8.71.0",
|
|
36
36
|
"@typescript-eslint/utils": "^8.71.0",
|