@eslint-react/var 5.20.6 → 5.20.8

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 CHANGED
@@ -110,15 +110,6 @@ export interface ImportLookupOptions {
110
110
  */
111
111
  export declare function createImportLookup(program: TSESTree.Program, options: ImportLookupOptions): ImportLookup;
112
112
  //#endregion
113
- //#region src/get-require-expression-arguments.d.ts
114
- /**
115
- * Get the arguments of a require expression.
116
- * @param node The node to check.
117
- * @returns The require expression arguments, or `null` when the node is not a require expression.
118
- * @internal
119
- */
120
- export declare function getRequireExpressionArguments(node: TSESTree.Node): TSESTree.CallExpressionArgument[] | null;
121
- //#endregion
122
113
  //#region src/is-assignment-target-equal.d.ts
123
114
  /**
124
115
  * Check if two assignment targets are equal, either directly or by their values.
@@ -203,7 +194,7 @@ export declare function resolve(context: RuleContext, node: TSESTree.Identifier,
203
194
  //#endregion
204
195
  //#region src/resolve-enclosing-assignment-target.d.ts
205
196
  /** The possible assignment targets returned by {@link resolveEnclosingAssignmentTarget}. */
206
- export type AssignmentTarget = ReturnType<typeof resolveEnclosingAssignmentTarget>;
197
+ export type EnclosingAssignmentTarget = ReturnType<typeof resolveEnclosingAssignmentTarget>;
207
198
  /**
208
199
  * Resolve the enclosing assignment target (variable, property, etc.) of the node.
209
200
  * @param node The starting node for the upward search.
package/dist/index.js CHANGED
@@ -582,25 +582,6 @@ function createImportLookup(program, options) {
582
582
  };
583
583
  }
584
584
 
585
- //#endregion
586
- //#region src/get-require-expression-arguments.ts
587
- /**
588
- * Get the arguments of a require expression.
589
- * @param node The node to check.
590
- * @returns The require expression arguments, or `null` when the node is not a require expression.
591
- * @internal
592
- */
593
- function getRequireExpressionArguments(node) {
594
- const unwrapped = Extract.unwrap(node);
595
- if (unwrapped.type === AST_NODE_TYPES.CallExpression) {
596
- const callee = Extract.unwrap(unwrapped.callee);
597
- if (Check.isIdentifier(callee, "require")) return unwrapped.arguments;
598
- return null;
599
- }
600
- if (unwrapped.type === AST_NODE_TYPES.MemberExpression) return getRequireExpressionArguments(unwrapped.object);
601
- return null;
602
- }
603
-
604
585
  //#endregion
605
586
  //#region src/resolve-origin.ts
606
587
  /**
@@ -757,6 +738,21 @@ function isAssignmentTargetEqual(context, a, b) {
757
738
  //#endregion
758
739
  //#region src/resolve-import-source.ts
759
740
  /**
741
+ * Get the arguments of a require expression.
742
+ * @param node The node to check.
743
+ * @returns The require expression arguments, or `null` when the node is not a require expression.
744
+ */
745
+ function getRequireExpressionArguments(node) {
746
+ const unwrapped = Extract.unwrap(node);
747
+ if (unwrapped.type === AST_NODE_TYPES.CallExpression) {
748
+ const callee = Extract.unwrap(unwrapped.callee);
749
+ if (Check.isIdentifier(callee, "require")) return unwrapped.arguments;
750
+ return null;
751
+ }
752
+ if (unwrapped.type === AST_NODE_TYPES.MemberExpression) return getRequireExpressionArguments(unwrapped.object);
753
+ return null;
754
+ }
755
+ /**
760
756
  * Resolve the import source of a variable by walking its latest definition.
761
757
  * @param name The variable name.
762
758
  * @param initialScope The initial scope.
@@ -1009,4 +1005,4 @@ function resolveObjectType(context, node) {
1009
1005
  }
1010
1006
 
1011
1007
  //#endregion
1012
- export { createImportLookup, getRequireExpressionArguments, isAssignmentTargetEqual, isInitializedFromReact, isInitializedFromReactNative, isValueEqual, resolve, resolveEnclosingAssignmentTarget, resolveImportSource, resolveObjectType, resolveOrigin };
1008
+ export { createImportLookup, isAssignmentTargetEqual, isInitializedFromReact, isInitializedFromReactNative, isValueEqual, resolve, resolveEnclosingAssignmentTarget, resolveImportSource, resolveObjectType, resolveOrigin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/var",
3
- "version": "5.20.6",
3
+ "version": "5.20.8",
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.20.6",
33
- "@eslint-react/eslint": "5.20.6",
32
+ "@eslint-react/ast": "5.20.8",
33
+ "@eslint-react/eslint": "5.20.8",
34
34
  "@typescript-eslint/scope-manager": "^8.70.0",
35
35
  "@typescript-eslint/types": "^8.70.0",
36
36
  "@typescript-eslint/utils": "^8.70.0",