From 83934354908bcd3c25d5835c8ba39bd6673874d4 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 9 Aug 2019 18:50:23 +1200 Subject: [PATCH] chore(tsutils): remove unused exports The following are now no longer exported: * `KnownMemberExpression` interface * `ExpectMember` interface * `StringNode` alias * `ExpectCall` interface * `MatcherName` alias * `EqualityMatcher` enum * `ExpectPropertyName` alias --- src/rules/tsUtils.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/rules/tsUtils.ts b/src/rules/tsUtils.ts index 24ea20877..68c6b3546 100644 --- a/src/rules/tsUtils.ts +++ b/src/rules/tsUtils.ts @@ -72,7 +72,7 @@ export const isTemplateLiteral = ( (node.quasis.length === 1 && // bail out if not simple node.quasis[0].value.raw === value)); -export type StringNode = +type StringNode = | StringLiteral | TemplateLiteral; @@ -110,7 +110,7 @@ export const getStringValue = (node: StringNode): S => /** * Represents a `MemberExpression` with a "known" `property`. */ -export interface KnownMemberExpression +interface KnownMemberExpression extends TSESTree.MemberExpression { property: AccessorNode; } @@ -232,7 +232,7 @@ type AccessorNode = | StringNode | KnownIdentifier; -export interface ExpectCall extends TSESTree.CallExpression { +interface ExpectCall extends TSESTree.CallExpression { callee: AccessorNode<'expect'>; parent: TSESTree.Node; } @@ -257,7 +257,7 @@ export const isExpectCall = (node: TSESTree.Node): node is ExpectCall => /** * Represents a `MemberExpression` that comes after an `ExpectCall`. */ -export interface ExpectMember< +interface ExpectMember< PropertyName extends ExpectPropertyName = ExpectPropertyName, Parent extends TSESTree.Node | undefined = TSESTree.Node | undefined > extends KnownMemberExpression { @@ -278,8 +278,8 @@ export const isExpectMember = < /** * Represents all the jest matchers. */ -export type MatcherName = string /* & not ModifierName */; -export type ExpectPropertyName = ModifierName | MatcherName; +type MatcherName = string /* & not ModifierName */; +type ExpectPropertyName = ModifierName | MatcherName; export type ParsedEqualityMatcherCall< Argument extends TSESTree.Expression = TSESTree.Expression @@ -288,6 +288,11 @@ export type ParsedEqualityMatcherCall< arguments: [Argument]; }; +enum EqualityMatcher { + toBe = 'toBe', + toEqual = 'toEqual', +} + export const isParsedEqualityMatcherCall = ( matcher: ParsedExpectMatcher, ): matcher is ParsedEqualityMatcherCall => @@ -295,11 +300,6 @@ export const isParsedEqualityMatcherCall = ( matcher.arguments !== null && matcher.arguments.length === 1; -export enum EqualityMatcher { - toBe = 'toBe', - toEqual = 'toEqual', -} - export enum ModifierName { not = 'not', rejects = 'rejects',