Skip to content

Commit

Permalink
chore(tsutils): remove unused exports
Browse files Browse the repository at this point in the history
The following are now no longer exported:
  * `KnownMemberExpression` interface
  * `ExpectMember` interface
  * `StringNode` alias
  * `ExpectCall` interface
  * `MatcherName` alias
  * `EqualityMatcher` enum
  * `ExpectPropertyName` alias
  • Loading branch information
G-Rath committed Aug 11, 2019
1 parent 6f375c3 commit 8393435
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/rules/tsUtils.ts
Expand Up @@ -72,7 +72,7 @@ export const isTemplateLiteral = <V extends string>(
(node.quasis.length === 1 && // bail out if not simple
node.quasis[0].value.raw === value));

export type StringNode<S extends string = string> =
type StringNode<S extends string = string> =
| StringLiteral<S>
| TemplateLiteral<S>;

Expand Down Expand Up @@ -110,7 +110,7 @@ export const getStringValue = <S extends string>(node: StringNode<S>): S =>
/**
* Represents a `MemberExpression` with a "known" `property`.
*/
export interface KnownMemberExpression<Name extends string = string>
interface KnownMemberExpression<Name extends string = string>
extends TSESTree.MemberExpression {
property: AccessorNode<Name>;
}
Expand Down Expand Up @@ -232,7 +232,7 @@ type AccessorNode<Specifics extends string = string> =
| StringNode<Specifics>
| KnownIdentifier<Specifics>;

export interface ExpectCall extends TSESTree.CallExpression {
interface ExpectCall extends TSESTree.CallExpression {
callee: AccessorNode<'expect'>;
parent: TSESTree.Node;
}
Expand All @@ -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<PropertyName> {
Expand All @@ -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
Expand All @@ -288,18 +288,18 @@ export type ParsedEqualityMatcherCall<
arguments: [Argument];
};

enum EqualityMatcher {
toBe = 'toBe',
toEqual = 'toEqual',
}

export const isParsedEqualityMatcherCall = (
matcher: ParsedExpectMatcher,
): matcher is ParsedEqualityMatcherCall =>
EqualityMatcher.hasOwnProperty(matcher.name) &&
matcher.arguments !== null &&
matcher.arguments.length === 1;

export enum EqualityMatcher {
toBe = 'toBe',
toEqual = 'toEqual',
}

export enum ModifierName {
not = 'not',
rejects = 'rejects',
Expand Down

0 comments on commit 8393435

Please sign in to comment.