@eslint-react/var 5.18.8 → 5.18.9
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 +12 -13
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { RuleContext } from "@eslint-react/eslint";
|
|
|
8
8
|
* @returns The require expression arguments or `null` if the node is not a require expression.
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
|
-
declare function getRequireExpressionArguments(node: TSESTree.Node): TSESTree.CallExpressionArgument[] | null;
|
|
11
|
+
export declare function getRequireExpressionArguments(node: TSESTree.Node): TSESTree.CallExpressionArgument[] | null;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/is-assignment-target-equal.d.ts
|
|
14
14
|
/**
|
|
@@ -19,7 +19,7 @@ declare function getRequireExpressionArguments(node: TSESTree.Node): TSESTree.Ca
|
|
|
19
19
|
* @returns `true` if the assignment targets are equal.
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
|
-
declare function isAssignmentTargetEqual(context: RuleContext, a: TSESTree.Node, b: TSESTree.Node): boolean;
|
|
22
|
+
export declare function isAssignmentTargetEqual(context: RuleContext, a: TSESTree.Node, b: TSESTree.Node): boolean;
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/is-initialized-from-react.d.ts
|
|
25
25
|
/**
|
|
@@ -30,7 +30,7 @@ declare function isAssignmentTargetEqual(context: RuleContext, a: TSESTree.Node,
|
|
|
30
30
|
* @returns `true` if the variable is initialized or derived from a React import.
|
|
31
31
|
* @internal
|
|
32
32
|
*/
|
|
33
|
-
declare function isInitializedFromReact(name: string, initialScope: Scope, importSource?: string): boolean;
|
|
33
|
+
export declare function isInitializedFromReact(name: string, initialScope: Scope, importSource?: string): boolean;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/is-initialized-from-react-native.d.ts
|
|
36
36
|
/**
|
|
@@ -41,7 +41,7 @@ declare function isInitializedFromReact(name: string, initialScope: Scope, impor
|
|
|
41
41
|
* @returns `true` if the variable is initialized from a React Native import.
|
|
42
42
|
* @internal
|
|
43
43
|
*/
|
|
44
|
-
declare function isInitializedFromReactNative(name: string, initialScope: Scope, importSource?: string): boolean;
|
|
44
|
+
export declare function isInitializedFromReactNative(name: string, initialScope: Scope, importSource?: string): boolean;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/is-value-equal.d.ts
|
|
47
47
|
/**
|
|
@@ -51,7 +51,7 @@ declare function isInitializedFromReactNative(name: string, initialScope: Scope,
|
|
|
51
51
|
* @param b The second node to compare.
|
|
52
52
|
* @returns `true` if the node values are equal.
|
|
53
53
|
*/
|
|
54
|
-
declare function isValueEqual(context: RuleContext, a: TSESTree.Node, b: TSESTree.Node): boolean;
|
|
54
|
+
export declare function isValueEqual(context: RuleContext, a: TSESTree.Node, b: TSESTree.Node): boolean;
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region src/resolve.d.ts
|
|
57
57
|
/**
|
|
@@ -84,7 +84,7 @@ declare function isValueEqual(context: RuleContext, a: TSESTree.Node, b: TSESTre
|
|
|
84
84
|
* correctly.
|
|
85
85
|
* @returns The resolved node, or `null` if the identifier cannot be resolved to a value node.
|
|
86
86
|
*/
|
|
87
|
-
declare function resolve(context: RuleContext, node: TSESTree.Identifier, options?: Partial<{
|
|
87
|
+
export declare function resolve(context: RuleContext, node: TSESTree.Identifier, options?: Partial<{
|
|
88
88
|
at: number;
|
|
89
89
|
localOnly: boolean;
|
|
90
90
|
}>): TSESTree.Node | null;
|
|
@@ -96,9 +96,9 @@ declare function resolve(context: RuleContext, node: TSESTree.Identifier, option
|
|
|
96
96
|
* @param node The starting node.
|
|
97
97
|
* @returns The enclosing assignment target node, or `null` if not found.
|
|
98
98
|
*/
|
|
99
|
-
declare function resolveEnclosingAssignmentTarget(node: TSESTree.Node): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassDeclarationWithOptionalName | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEnumDeclaration | TSESTree.TSInstantiationExpression | TSESTree.TSInterfaceDeclaration | TSESTree.TSModuleDeclarationGlobal | TSESTree.TSModuleDeclarationModuleWithIdentifierId | TSESTree.TSModuleDeclarationModuleWithStringIdDeclared | TSESTree.TSModuleDeclarationModuleWithStringIdNotDeclared | TSESTree.TSModuleDeclarationNamespace | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAliasDeclaration | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.ConstDeclaration | TSESTree.LetOrVarDeclaredDeclaration | TSESTree.LetOrVarNonDeclaredDeclaration | TSESTree.UsingInForOfDeclaration | TSESTree.UsingInNormalContextDeclaration | TSESTree.YieldNoStarExpression | TSESTree.YieldStarExpression | null;
|
|
99
|
+
export declare function resolveEnclosingAssignmentTarget(node: TSESTree.Node): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassDeclarationWithOptionalName | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEnumDeclaration | TSESTree.TSInstantiationExpression | TSESTree.TSInterfaceDeclaration | TSESTree.TSModuleDeclarationGlobal | TSESTree.TSModuleDeclarationModuleWithIdentifierId | TSESTree.TSModuleDeclarationModuleWithStringIdDeclared | TSESTree.TSModuleDeclarationModuleWithStringIdNotDeclared | TSESTree.TSModuleDeclarationNamespace | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAliasDeclaration | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.ConstDeclaration | TSESTree.LetOrVarDeclaredDeclaration | TSESTree.LetOrVarNonDeclaredDeclaration | TSESTree.UsingInForOfDeclaration | TSESTree.UsingInNormalContextDeclaration | TSESTree.YieldNoStarExpression | TSESTree.YieldStarExpression | null;
|
|
100
100
|
/** The possible assignment targets returned by {@link resolveEnclosingAssignmentTarget}. */
|
|
101
|
-
type AssignmentTarget = ReturnType<typeof resolveEnclosingAssignmentTarget>;
|
|
101
|
+
export type AssignmentTarget = ReturnType<typeof resolveEnclosingAssignmentTarget>;
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/resolve-import-source.d.ts
|
|
104
104
|
/**
|
|
@@ -108,13 +108,13 @@ type AssignmentTarget = ReturnType<typeof resolveEnclosingAssignmentTarget>;
|
|
|
108
108
|
* @param seen The set of already visited variable names (for cycle detection).
|
|
109
109
|
* @returns The import source, or `null` if it cannot be resolved.
|
|
110
110
|
*/
|
|
111
|
-
declare function resolveImportSource(name: string, initialScope: Scope, seen?: Set<string>): string | null;
|
|
111
|
+
export declare function resolveImportSource(name: string, initialScope: Scope, seen?: Set<string>): string | null;
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/resolve-object-type.d.ts
|
|
114
114
|
/**
|
|
115
115
|
* Represents the type classification of an object node.
|
|
116
116
|
*/
|
|
117
|
-
type ObjectType = {
|
|
117
|
+
export type ObjectType = {
|
|
118
118
|
kind: "jsx";
|
|
119
119
|
node: TSESTree.JSXElement | TSESTree.JSXFragment;
|
|
120
120
|
} | {
|
|
@@ -146,6 +146,5 @@ type ObjectType = {
|
|
|
146
146
|
* @param node The node to resolve.
|
|
147
147
|
* @returns The object type of the node, or `null` if it cannot be resolved.
|
|
148
148
|
*/
|
|
149
|
-
declare function resolveObjectType(context: RuleContext, node: TSESTree.Node | null): ObjectType | null;
|
|
150
|
-
//#endregion
|
|
151
|
-
export { AssignmentTarget, ObjectType, getRequireExpressionArguments, isAssignmentTargetEqual, isInitializedFromReact, isInitializedFromReactNative, isValueEqual, resolve, resolveEnclosingAssignmentTarget, resolveImportSource, resolveObjectType };
|
|
149
|
+
export declare function resolveObjectType(context: RuleContext, node: TSESTree.Node | null): ObjectType | null;
|
|
150
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/var",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.9",
|
|
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.18.
|
|
33
|
-
"@eslint-react/eslint": "5.18.
|
|
32
|
+
"@eslint-react/ast": "5.18.9",
|
|
33
|
+
"@eslint-react/eslint": "5.18.9",
|
|
34
34
|
"@typescript-eslint/scope-manager": "^8.69.0",
|
|
35
35
|
"@typescript-eslint/types": "^8.69.0",
|
|
36
36
|
"@typescript-eslint/utils": "^8.69.0",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"@local/testkit": "0.0.0",
|
|
43
43
|
"@typescript-eslint/parser": "^8.69.0",
|
|
44
44
|
"@typescript-eslint/typescript-estree": "^8.69.0",
|
|
45
|
-
"eslint": "^10.
|
|
46
|
-
"tsdown": "^0.
|
|
45
|
+
"eslint": "^10.10.0",
|
|
46
|
+
"tsdown": "^0.23.0",
|
|
47
47
|
"typescript": "6.0.3",
|
|
48
|
-
"vitest": "^
|
|
48
|
+
"vitest": "^5.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"eslint": "*",
|