Skip to content

Commit f675513

Browse files
Use import/no-duplicates lint rule (#3059)
1 parent 7204408 commit f675513

File tree

55 files changed

+301
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+301
-298
lines changed

eslint.config.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const rootConfig: ConfigWithExtends = {
5353

5454
rules: {
5555
"import/no-relative-packages": "error",
56+
"import/no-duplicates": "error",
57+
"unused-imports/no-unused-imports": "error",
5658
"@typescript-eslint/consistent-type-imports": "error",
5759
"@typescript-eslint/consistent-type-assertions": [
5860
"error",
@@ -75,7 +77,6 @@ const rootConfig: ConfigWithExtends = {
7577
"@typescript-eslint/no-explicit-any": "off",
7678
"@typescript-eslint/no-inferrable-types": "off",
7779
"@typescript-eslint/no-non-null-assertion": "off",
78-
"unused-imports/no-unused-imports": "error",
7980
"@typescript-eslint/no-unused-vars": [
8081
"error",
8182
{

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
},
3333
"devDependencies": {
3434
"@eslint/eslintrc": "^3.3.1",
35-
"@eslint/js": "^9.31.0",
35+
"@eslint/js": "^9.32.0",
3636
"@pnpm/meta-updater": "^2.0.6",
3737
"@types/node": "^24.1.0",
3838
"esbuild": "^0.25.8",
39-
"eslint": "^9.31.0",
39+
"eslint": "^9.32.0",
4040
"eslint-config-prettier": "^10.1.8",
4141
"eslint-import-resolver-typescript": "^4.4.4",
4242
"eslint-plugin-import": "^2.32.0",

packages/common/src/scopeSupportFacets/scopeSupportFacets.types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import type { SimpleScopeTypeType } from "../types/command/PartialTargetDescriptor.types";
2-
import { type ScopeType } from "../types/command/PartialTargetDescriptor.types";
1+
import type {
2+
ScopeType,
3+
SimpleScopeTypeType,
4+
} from "../types/command/PartialTargetDescriptor.types";
35

46
export const scopeSupportFacets = [
57
"command",

packages/cursorless-engine/src/CommandHistory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import type {
22
ActionDescriptor,
33
CommandComplete,
44
CommandHistoryEntry,
5+
CommandHistoryStorage,
56
CommandServerApi,
67
IDE,
78
ReadOnlyHatMap,
89
} from "@cursorless/common";
9-
import { type CommandHistoryStorage } from "@cursorless/common";
1010
import { produce } from "immer";
1111
import { v4 as uuid } from "uuid";
1212
import type { CommandRunner } from "./CommandRunner";

packages/cursorless-engine/src/CommandHistoryAnalyzer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type {
22
CommandHistoryEntry,
3+
CommandHistoryStorage,
34
Modifier,
45
PartialPrimitiveTargetDescriptor,
56
ScopeType,
67
} from "@cursorless/common";
7-
import { showWarning, type CommandHistoryStorage } from "@cursorless/common";
8+
import { showWarning } from "@cursorless/common";
89
import { groupBy, map, sum } from "lodash-es";
910
import { canonicalizeAndValidateCommand } from "./core/commandVersionUpgrades/canonicalizeAndValidateCommand";
1011
import { ide } from "./singletons/ide.singleton";

packages/cursorless-engine/src/core/StoredTargets.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { DefaultMap, Notifier } from "@cursorless/common";
2-
import type { Target } from "../typings/target.types";
31
import type { StoredTargetKey } from "@cursorless/common";
4-
import { storedTargetKeys } from "@cursorless/common";
2+
import { DefaultMap, Notifier, storedTargetKeys } from "@cursorless/common";
3+
import type { Target } from "../typings/target.types";
54
import { UndoStack } from "./UndoStack";
65

76
const MAX_HISTORY_LENGTH = 25;

packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV1ToV2/upgradeV1ToV2.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import type { ActionType, ActionTypeV2 } from "@cursorless/common";
2-
import type { CommandV2 } from "@cursorless/common";
31
import type {
2+
ActionType,
3+
ActionTypeV2,
4+
CommandV1,
5+
CommandV2,
6+
ModifierV0V1,
47
ModifierV2,
58
PartialPrimitiveTargetDescriptorV2,
9+
PartialPrimitiveTargetV0V1,
610
PartialRangeTargetDescriptorV2,
711
PartialTargetDescriptorV2,
8-
SimpleScopeTypeTypeV2,
9-
} from "@cursorless/common";
10-
import type {
11-
CommandV1,
12-
ModifierV0V1,
13-
PartialPrimitiveTargetV0V1,
1412
PartialTargetV0V1,
13+
SimpleScopeTypeTypeV2,
1514
} from "@cursorless/common";
1615
import { upgradeStrictHere } from "./upgradeStrictHere";
1716

packages/cursorless-engine/src/core/commandVersionUpgrades/upgradeV5ToV6/upgradeV5ToV6.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import type {
55
CommandV6,
66
DestinationDescriptor,
77
EnforceUndefined,
8+
ExecuteCommandOptions,
9+
GetTextActionOptions,
810
HighlightActionDescriptor,
911
HighlightId,
1012
ImplicitDestinationDescriptor,
@@ -27,10 +29,6 @@ import type {
2729
ReplaceWith,
2830
WrapWithSnippetArg,
2931
} from "@cursorless/common";
30-
import {
31-
type ExecuteCommandOptions,
32-
type GetTextActionOptions,
33-
} from "@cursorless/common";
3432
import canonicalizeActionName from "./canonicalizeActionName";
3533

3634
export function upgradeV5ToV6(command: CommandV5): EnforceUndefined<CommandV6> {

packages/cursorless-engine/src/cursorlessEngine.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import type {
33
CommandServerApi,
44
Hats,
55
IDE,
6+
RawTreeSitterQueryProvider,
67
ScopeProvider,
8+
TalonSpokenForms,
9+
TreeSitter,
710
} from "@cursorless/common";
8-
import {
9-
ensureCommandShape,
10-
type RawTreeSitterQueryProvider,
11-
type TalonSpokenForms,
12-
type TreeSitter,
13-
} from "@cursorless/common";
11+
import { ensureCommandShape } from "@cursorless/common";
1412
import { KeyboardTargetUpdater } from "./KeyboardTargetUpdater";
1513
import type {
1614
CommandRunnerDecorator,

packages/cursorless-engine/src/customCommandGrammar/grammarUtil.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
import type {
22
BringMoveActionDescriptor,
3+
ContainingScopeModifier,
34
DestinationDescriptor,
45
Direction,
56
InsertionMode,
7+
Modifier,
68
PartialListTargetDescriptor,
9+
PartialMark,
10+
PartialPrimitiveTargetDescriptor,
711
PartialRangeTargetDescriptor,
12+
PartialTargetDescriptor,
813
PartialTargetMark,
914
PrimitiveDestinationDescriptor,
1015
RelativeScopeModifier,
11-
} from "@cursorless/common";
12-
import {
13-
type ContainingScopeModifier,
14-
type Modifier,
15-
type PartialMark,
16-
type PartialPrimitiveTargetDescriptor,
17-
type PartialTargetDescriptor,
18-
type ScopeType,
19-
type SimpleActionDescriptor,
20-
type SimpleActionName,
21-
type SimplePartialMark,
22-
type SimpleScopeType,
23-
type SimpleScopeTypeType,
24-
type SurroundingPairName,
25-
type SurroundingPairScopeType,
16+
ScopeType,
17+
SimpleActionDescriptor,
18+
SimpleActionName,
19+
SimplePartialMark,
20+
SimpleScopeType,
21+
SimpleScopeTypeType,
22+
SurroundingPairName,
23+
SurroundingPairScopeType,
2624
} from "@cursorless/common";
2725
import type { WithPlaceholders } from "./WithPlaceholders";
2826

0 commit comments

Comments
 (0)