Skip to content

Commit

Permalink
style: fix import/no-duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Jul 30, 2023
1 parent 4c80b0a commit 7739c6b
Show file tree
Hide file tree
Showing 25 changed files with 30 additions and 50 deletions.
4 changes: 1 addition & 3 deletions src/rules/functional-parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { deepmerge } from "deepmerge-ts";
import {
type IgnoreIdentifierPatternOption,
type IgnorePrefixSelectorOption,
} from "#eslint-plugin-functional/options";
import {
shouldIgnorePattern,
ignoreIdentifierPatternOptionSchema,
ignorePrefixSelectorOptionSchema,
Expand All @@ -19,8 +17,8 @@ import { type ESFunction } from "#eslint-plugin-functional/utils/node-types";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRuleUsingFunction,
} from "#eslint-plugin-functional/utils/rule";
import { createRuleUsingFunction } from "#eslint-plugin-functional/utils/rule";
import {
isArgument,
isGetter,
Expand Down
4 changes: 0 additions & 4 deletions src/rules/immutable-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {
type IgnoreAccessorPatternOption,
type IgnoreIdentifierPatternOption,
type IgnoreClassesOption,
} from "#eslint-plugin-functional/options";
import {
shouldIgnorePattern,
shouldIgnoreClasses,
ignoreAccessorPatternOptionSchema,
Expand All @@ -22,8 +20,6 @@ import { isExpected } from "#eslint-plugin-functional/utils/misc";
import {
createRule,
getTypeOfNode,
} from "#eslint-plugin-functional/utils/rule";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { type ESClass } from "#eslint-plugin-functional/utils/node-types";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRule,
} from "#eslint-plugin-functional/utils/rule";
import { createRule } from "#eslint-plugin-functional/utils/rule";

/**
* The name of this rule.
Expand Down
2 changes: 0 additions & 2 deletions src/rules/no-conditional-statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import tsApiUtils from "#eslint-plugin-functional/conditional-imports/ts-api-uti
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
import {
createRule,
getTypeOfNode,
} from "#eslint-plugin-functional/utils/rule";
Expand Down
4 changes: 1 addition & 3 deletions src/rules/no-expression-statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ import { isThisKeyword } from "ts-api-utils";

import tsApiUtils from "#eslint-plugin-functional/conditional-imports/ts-api-utils";
import typescript from "#eslint-plugin-functional/conditional-imports/typescript";
import { type IgnoreCodePatternOption } from "#eslint-plugin-functional/options";
import {
type IgnoreCodePatternOption,
shouldIgnorePattern,
ignoreCodePatternOptionSchema,
} from "#eslint-plugin-functional/options";
import { isDirectivePrologue } from "#eslint-plugin-functional/utils/misc";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
import {
createRule,
getTypeOfNode,
} from "#eslint-plugin-functional/utils/rule";
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no-let.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";
import { deepmerge } from "deepmerge-ts";

import { type IgnoreIdentifierPatternOption } from "#eslint-plugin-functional/options";
import {
type IgnoreIdentifierPatternOption,
shouldIgnorePattern,
shouldIgnoreInFunction,
ignoreIdentifierPatternOptionSchema,
} from "#eslint-plugin-functional/options";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRule,
} from "#eslint-plugin-functional/utils/rule";
import { createRule } from "#eslint-plugin-functional/utils/rule";
import { isInForLoopInitializer } from "#eslint-plugin-functional/utils/tree";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-loop-statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { type ESLoop } from "#eslint-plugin-functional/utils/node-types";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRule,
} from "#eslint-plugin-functional/utils/rule";
import { createRule } from "#eslint-plugin-functional/utils/rule";

/**
* The name of this rule.
Expand Down
5 changes: 2 additions & 3 deletions src/rules/no-mixed-types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { type TSESTree } from "@typescript-eslint/utils";
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
import { type TSESTree, AST_NODE_TYPES } from "@typescript-eslint/utils";
import { type JSONSchema4 } from "@typescript-eslint/utils/json-schema";
import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";

import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRuleUsingFunction,
} from "#eslint-plugin-functional/utils/rule";
import { createRuleUsingFunction } from "#eslint-plugin-functional/utils/rule";
import {
isIdentifier,
isTSPropertySignature,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-promise-reject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRule,
} from "#eslint-plugin-functional/utils/rule";
import { createRule } from "#eslint-plugin-functional/utils/rule";
import {
isIdentifier,
isMemberExpression,
Expand Down
2 changes: 0 additions & 2 deletions src/rules/no-return-void.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { type ESFunctionType } from "#eslint-plugin-functional/utils/node-types"
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
import {
createRule,
getTypeOfNode,
} from "#eslint-plugin-functional/utils/rule";
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-this-expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRule,
} from "#eslint-plugin-functional/utils/rule";
import { createRule } from "#eslint-plugin-functional/utils/rule";

/**
* The name of this rule.
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-throw-statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRule,
} from "#eslint-plugin-functional/utils/rule";
import { createRule } from "#eslint-plugin-functional/utils/rule";
import { isInFunctionBody } from "#eslint-plugin-functional/utils/tree";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-try-statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRule,
} from "#eslint-plugin-functional/utils/rule";
import { createRule } from "#eslint-plugin-functional/utils/rule";

/**
* The name of this rule.
Expand Down
4 changes: 1 addition & 3 deletions src/rules/prefer-immutable-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
import { deepmerge } from "deepmerge-ts";
import { Immutability } from "is-immutable-type";

import { type IgnoreClassesOption } from "#eslint-plugin-functional/options";
import {
type IgnoreClassesOption,
ignoreClassesOptionSchema,
shouldIgnoreClasses,
shouldIgnoreInFunction,
Expand All @@ -21,8 +21,6 @@ import { type ESFunctionType } from "#eslint-plugin-functional/utils/node-types"
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
import {
createRule,
getReturnTypesOfFunction,
getTypeImmutabilityOfNode,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/prefer-property-signatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
createRule,
} from "#eslint-plugin-functional/utils/rule";
import { createRule } from "#eslint-plugin-functional/utils/rule";
import { isInReadonly } from "#eslint-plugin-functional/utils/tree";

/**
Expand Down
4 changes: 0 additions & 4 deletions src/rules/prefer-readonly-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";
import {
type IgnoreCodePatternOption,
type IgnoreAccessorPatternOption,
} from "#eslint-plugin-functional/options";
import {
shouldIgnoreInFunction,
shouldIgnoreClasses,
shouldIgnorePattern,
Expand All @@ -16,8 +14,6 @@ import {
type BaseOptions,
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
import {
createRule,
getTypeOfNode,
} from "#eslint-plugin-functional/utils/rule";
Expand Down
2 changes: 0 additions & 2 deletions src/rules/prefer-tacit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import { type ESFunction } from "#eslint-plugin-functional/utils/node-types";
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
import {
createRule,
getESTreeNode,
getTypeOfNode,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/readonly-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
type RuleContext,
} from "@typescript-eslint/utils/ts-eslint";

import { createRule } from "#eslint-plugin-functional/utils/rule";
import {
createRule,
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
Expand Down
4 changes: 1 addition & 3 deletions src/rules/type-declaration-immutability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";
import { deepmerge } from "deepmerge-ts";
import { Immutability } from "is-immutable-type";

import { type IgnoreIdentifierPatternOption } from "#eslint-plugin-functional/options";
import {
type IgnoreIdentifierPatternOption,
shouldIgnorePattern,
ignoreIdentifierPatternOptionSchema,
} from "#eslint-plugin-functional/options";
Expand All @@ -17,8 +17,6 @@ import { type ESTypeDeclaration } from "#eslint-plugin-functional/utils/node-typ
import {
type RuleResult,
type NamedCreateRuleMetaWithCategory,
} from "#eslint-plugin-functional/utils/rule";
import {
getTypeImmutabilityOfNode,
createRule,
} from "#eslint-plugin-functional/utils/rule";
Expand Down
2 changes: 0 additions & 2 deletions src/settings/immutability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { type SharedConfigurationSettings } from "@typescript-eslint/utils";
import {
type ImmutabilityOverrides,
type TypeSpecifier,
} from "is-immutable-type";
import {
Immutability,
getDefaultOverrides as getDefaultImmutabilityOverrides,
} from "is-immutable-type";
Expand Down
3 changes: 1 addition & 2 deletions src/utils/misc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type TSESTree } from "@typescript-eslint/utils";
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
import { type TSESTree, AST_NODE_TYPES } from "@typescript-eslint/utils";
import { type RuleContext } from "@typescript-eslint/utils/ts-eslint";

import { type BaseOptions } from "#eslint-plugin-functional/utils/rule";
Expand Down
7 changes: 5 additions & 2 deletions src/utils/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ import {
type ReportDescriptor,
type RuleListener,
} from "@typescript-eslint/utils/ts-eslint";
import { type ImmutabilityOverrides } from "is-immutable-type";
import { getTypeImmutability, Immutability } from "is-immutable-type";
import {
type ImmutabilityOverrides,
getTypeImmutability,
Immutability,
} from "is-immutable-type";
import { type Node as TSNode, type Type, type TypeNode } from "typescript";

import ts from "#eslint-plugin-functional/conditional-imports/typescript";
Expand Down
3 changes: 1 addition & 2 deletions src/utils/type-guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* @file Functions that type guard the given node/type.
*/

import { type TSESTree } from "@typescript-eslint/utils";
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
import { type TSESTree, AST_NODE_TYPES } from "@typescript-eslint/utils";
import { type Type, type UnionType } from "typescript";

import ts from "#eslint-plugin-functional/conditional-imports/typescript";
Expand Down
2 changes: 1 addition & 1 deletion tests/common/ignore-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
type IgnoreIdentifierPatternOption,
type IgnoreAccessorPatternOption,
type IgnoreCodePatternOption,
shouldIgnorePattern,
} from "#eslint-plugin-functional/options";
import { shouldIgnorePattern } from "#eslint-plugin-functional/options";
import { getRuleTester } from "#eslint-plugin-functional/tests/helpers/RuleTester";
import {
filename,
Expand Down
8 changes: 6 additions & 2 deletions tests/helpers/testers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import { type RuleModule } from "@typescript-eslint/utils/ts-eslint";

import { getRuleTester } from "./RuleTester";
import { configs } from "./configs";
import { processInvalidTestCase, processValidTestCase } from "./util";
import { type ValidTestCaseSet, type InvalidTestCaseSet } from "./util";
import {
processInvalidTestCase,
processValidTestCase,
type ValidTestCaseSet,
type InvalidTestCaseSet,
} from "./util";

type TestFunction<
TMessageIds extends string,
Expand Down

0 comments on commit 7739c6b

Please sign in to comment.