@eslint-react/ast 5.0.1-beta.3 → 5.0.1-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.d.ts +2 -35
- package/dist/index.js +4 -42
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -434,7 +434,6 @@ type ObjectDestructuringVariableDeclarator = TSESTree.VariableDeclarator & {
|
|
|
434
434
|
* Represents an assignment expression that assigns to a displayName property
|
|
435
435
|
*/
|
|
436
436
|
type DisplayNameAssignmentExpression = TSESTree.AssignmentExpression & {
|
|
437
|
-
type: "AssignmentExpression";
|
|
438
437
|
left: TSESTree.MemberExpression & {
|
|
439
438
|
property: TSESTree.Identifier & {
|
|
440
439
|
name: "displayName";
|
|
@@ -498,39 +497,7 @@ declare function isProcessEnvNodeEnv(node: TSESTree.Node | null): node is TSESTr
|
|
|
498
497
|
declare function isProcessEnvNodeEnvCompare(node: TSESTree.Node | null, operator: "===" | "!==", value: "development" | "production"): node is TSESTree.BinaryExpression;
|
|
499
498
|
//#endregion
|
|
500
499
|
//#region src/pattern-test-mock.d.ts
|
|
501
|
-
|
|
502
|
-
* Check if the given node is a `vi.mock`.
|
|
503
|
-
* @param node The node to check
|
|
504
|
-
* @returns `true` if the node is a `vi.mock`, otherwise `false`.
|
|
505
|
-
* @internal
|
|
506
|
-
*/
|
|
507
|
-
declare function isViMock(node: TSESTree.Node | null): node is TSESTree.MemberExpression;
|
|
508
|
-
/**
|
|
509
|
-
* Check if the given node is a `jest.mock`.
|
|
510
|
-
* @param node The node to check
|
|
511
|
-
* @returns `true` if the node is a `jest.mock`, otherwise `false`.
|
|
512
|
-
* @internal
|
|
513
|
-
*/
|
|
514
|
-
declare function isJestMock(node: TSESTree.Node | null): node is TSESTree.MemberExpression;
|
|
515
|
-
/**
|
|
516
|
-
* Check if the given node is a `vi.mock` callback.
|
|
517
|
-
* @param node The node to check
|
|
518
|
-
* @returns `true` if the node is a `vi.mock` callback, otherwise `false`.
|
|
519
|
-
* @internal
|
|
520
|
-
*/
|
|
521
|
-
declare function isViMockCallback(node: TSESTree.Node | null): boolean;
|
|
522
|
-
/**
|
|
523
|
-
* Check if the given node is a `jest.mock` callback.
|
|
524
|
-
* @param node The node to check
|
|
525
|
-
* @returns `true` if the node is a `jest.mock` callback, otherwise `false`.
|
|
526
|
-
* @internal
|
|
527
|
-
*/
|
|
528
|
-
declare function isJestMockCallback(node: TSESTree.Node | null): boolean;
|
|
529
|
-
/**
|
|
530
|
-
* Check if the given node is a `vi.mock` or `jest.mock` callback.
|
|
531
|
-
* @param node The node to check
|
|
532
|
-
* @returns `true` if the node is a test mock callback, otherwise `false`.
|
|
533
|
-
*/
|
|
500
|
+
declare function isTestMock(node: TSESTree.Node | null): node is TSESTree.MemberExpression;
|
|
534
501
|
declare function isTestMockCallback(node: TSESTree.Node | null): boolean;
|
|
535
502
|
//#endregion
|
|
536
503
|
//#region src/property-name.d.ts
|
|
@@ -553,4 +520,4 @@ declare function getPropertyName(node: TSESTree.Node): string | null;
|
|
|
553
520
|
*/
|
|
554
521
|
declare function findProperty(properties: TSESTree.ObjectLiteralElement[], name: string): TSESTree.Property | null;
|
|
555
522
|
//#endregion
|
|
556
|
-
export { DirectiveKind, DisplayNameAssignmentExpression, FunctionID, FunctionInitPath, ImplicitReturnArrowFunctionExpression, ObjectDestructuringVariableDeclarator, SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, TSESTreeArrayTupleType, TSESTreeClass, TSESTreeDestructuringPattern, TSESTreeDirective, TSESTreeDirectiveLike, TSESTreeFunction, TSESTreeFunctionType, TSESTreeJSX, TSESTreeJSXAttributeLike, TSESTreeJSXElementLike, TSESTreeLoop, TSESTreeMethodOrProperty, TSESTreeProperty, TSESTreeTypeAssertionExpression, TSESTreeTypeDeclaration, TSESTreeTypeExpression, findParent, findProperty, getClassId, getFileDirectives, getFullyQualifiedName, getFunctionDirectives, getFunctionId, getFunctionInitPath, getHumanReadableKind, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getRootIdentifier, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isDirective, isDirectiveInFile, isDirectiveInFunction, isDirectiveKind, isDirectiveLike, isDirectiveName, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isIdentifier, isIdentifierName, isJSX, isJSXElement, isJSXElementLike, isJSXFragment, isJSXTagNameExpression,
|
|
523
|
+
export { DirectiveKind, DisplayNameAssignmentExpression, FunctionID, FunctionInitPath, ImplicitReturnArrowFunctionExpression, ObjectDestructuringVariableDeclarator, SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, TSESTreeArrayTupleType, TSESTreeClass, TSESTreeDestructuringPattern, TSESTreeDirective, TSESTreeDirectiveLike, TSESTreeFunction, TSESTreeFunctionType, TSESTreeJSX, TSESTreeJSXAttributeLike, TSESTreeJSXElementLike, TSESTreeLoop, TSESTreeMethodOrProperty, TSESTreeProperty, TSESTreeTypeAssertionExpression, TSESTreeTypeDeclaration, TSESTreeTypeExpression, findParent, findProperty, getClassId, getFileDirectives, getFullyQualifiedName, getFunctionDirectives, getFunctionId, getFunctionInitPath, getHumanReadableKind, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getRootIdentifier, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isDirective, isDirectiveInFile, isDirectiveInFunction, isDirectiveKind, isDirectiveLike, isDirectiveName, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isIdentifier, isIdentifierName, isJSX, isJSXElement, isJSXElementLike, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isTestMock, isTestMockCallback, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression };
|
package/dist/index.js
CHANGED
|
@@ -926,49 +926,11 @@ function isProcessEnvNodeEnvCompare(node, operator, value) {
|
|
|
926
926
|
|
|
927
927
|
//#endregion
|
|
928
928
|
//#region src/pattern-test-mock.ts
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
* @param node The node to check
|
|
932
|
-
* @returns `true` if the node is a `vi.mock`, otherwise `false`.
|
|
933
|
-
* @internal
|
|
934
|
-
*/
|
|
935
|
-
function isViMock(node) {
|
|
936
|
-
return node != null && node.type === AST_NODE_TYPES.MemberExpression && node.object.type === AST_NODE_TYPES.Identifier && node.object.name === "vi" && node.property.type === AST_NODE_TYPES.Identifier && node.property.name === "mock";
|
|
937
|
-
}
|
|
938
|
-
/**
|
|
939
|
-
* Check if the given node is a `jest.mock`.
|
|
940
|
-
* @param node The node to check
|
|
941
|
-
* @returns `true` if the node is a `jest.mock`, otherwise `false`.
|
|
942
|
-
* @internal
|
|
943
|
-
*/
|
|
944
|
-
function isJestMock(node) {
|
|
945
|
-
return node != null && node.type === AST_NODE_TYPES.MemberExpression && node.object.type === AST_NODE_TYPES.Identifier && node.object.name === "jest" && node.property.type === AST_NODE_TYPES.Identifier && node.property.name === "mock";
|
|
946
|
-
}
|
|
947
|
-
/**
|
|
948
|
-
* Check if the given node is a `vi.mock` callback.
|
|
949
|
-
* @param node The node to check
|
|
950
|
-
* @returns `true` if the node is a `vi.mock` callback, otherwise `false`.
|
|
951
|
-
* @internal
|
|
952
|
-
*/
|
|
953
|
-
function isViMockCallback(node) {
|
|
954
|
-
return node != null && isFunction(node) && node.parent.type === AST_NODE_TYPES.CallExpression && isViMock(node.parent.callee) && node.parent.arguments[1] === node;
|
|
929
|
+
function isTestMock(node) {
|
|
930
|
+
return node != null && node.type === AST_NODE_TYPES.MemberExpression && node.object.type === AST_NODE_TYPES.Identifier && node.property.type === AST_NODE_TYPES.Identifier && node.property.name === "mock";
|
|
955
931
|
}
|
|
956
|
-
/**
|
|
957
|
-
* Check if the given node is a `jest.mock` callback.
|
|
958
|
-
* @param node The node to check
|
|
959
|
-
* @returns `true` if the node is a `jest.mock` callback, otherwise `false`.
|
|
960
|
-
* @internal
|
|
961
|
-
*/
|
|
962
|
-
function isJestMockCallback(node) {
|
|
963
|
-
return node != null && isFunction(node) && node.parent.type === AST_NODE_TYPES.CallExpression && isJestMock(node.parent.callee) && node.parent.arguments[1] === node;
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* Check if the given node is a `vi.mock` or `jest.mock` callback.
|
|
967
|
-
* @param node The node to check
|
|
968
|
-
* @returns `true` if the node is a test mock callback, otherwise `false`.
|
|
969
|
-
*/
|
|
970
932
|
function isTestMockCallback(node) {
|
|
971
|
-
return
|
|
933
|
+
return node != null && isFunction(node) && node.parent.type === AST_NODE_TYPES.CallExpression && isTestMock(node.parent.callee) && node.parent.arguments[1] === node;
|
|
972
934
|
}
|
|
973
935
|
|
|
974
936
|
//#endregion
|
|
@@ -1009,4 +971,4 @@ function findProperty(properties, name) {
|
|
|
1009
971
|
}
|
|
1010
972
|
|
|
1011
973
|
//#endregion
|
|
1012
|
-
export { SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, findParent, findProperty, getClassId, getFileDirectives, getFullyQualifiedName, getFunctionDirectives, getFunctionId, getFunctionInitPath, getHumanReadableKind, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getRootIdentifier, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isDirective, isDirectiveInFile, isDirectiveInFunction, isDirectiveKind, isDirectiveLike, isDirectiveName, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isIdentifier, isIdentifierName, isJSX, isJSXElement, isJSXElementLike, isJSXFragment, isJSXTagNameExpression,
|
|
974
|
+
export { SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, findParent, findProperty, getClassId, getFileDirectives, getFullyQualifiedName, getFunctionDirectives, getFunctionId, getFunctionInitPath, getHumanReadableKind, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getRootIdentifier, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isDirective, isDirectiveInFile, isDirectiveInFunction, isDirectiveKind, isDirectiveLike, isDirectiveName, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isIdentifier, isIdentifierName, isJSX, isJSXElement, isJSXElementLike, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isTestMock, isTestMockCallback, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression };
|