Skip to content

consistent-type-imports rule #2619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
],
"rules": {
"import/no-relative-packages": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-assertions": [
"error",
{
Expand Down
3 changes: 2 additions & 1 deletion packages/cheatsheet-local/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CheatsheetPage, CheatsheetInfo } from "@cursorless/cheatsheet";
import type { CheatsheetInfo } from "@cursorless/cheatsheet";
import { CheatsheetPage } from "@cursorless/cheatsheet";
import "../styles.css";

declare global {
Expand Down
2 changes: 1 addition & 1 deletion packages/cheatsheet/src/lib/cheatsheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCircleQuestion } from "@fortawesome/free-solid-svg-icons/faCircleQuestion";
import CheatsheetNotesComponent from "./components/CheatsheetNotesComponent";
import SmartLink from "./components/SmartLink";
import { CheatsheetInfo } from "./CheatsheetInfo";
import type { CheatsheetInfo } from "./CheatsheetInfo";

type CheatsheetPageProps = {
cheatsheetInfo: CheatsheetInfo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { CheatsheetLegend } from "../cheatsheetLegend";
import type { CheatsheetLegend } from "../cheatsheetLegend";
import useIsHighlighted from "../hooks/useIsHighlighted";
import { formatCaptures } from "./formatCaptures";
import SmartLink from "./SmartLink";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CheatsheetSection, Variation } from "../CheatsheetInfo";
import type { CheatsheetSection, Variation } from "../CheatsheetInfo";
import useIsHighlighted from "../hooks/useIsHighlighted";
import { formatCaptures } from "./formatCaptures";

Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/FakeCommandServerApi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
CommandServerApi,
FocusedElementType,
InboundSignal,
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/ide/fake/FakeCapabilities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Capabilities } from "../types/Capabilities";
import type { Capabilities } from "../types/Capabilities";

export class FakeCapabilities implements Capabilities {
commands = {
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/ide/fake/FakeConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { get } from "lodash-es";
import { Notifier } from "../../util/Notifier";
import {
import type {
Configuration,
ConfigurationScope,
CONFIGURATION_DEFAULTS,
CursorlessConfigKey,
CursorlessConfiguration,
} from "../types/Configuration";
import { GetFieldType, Paths } from "../types/Paths";
import { CONFIGURATION_DEFAULTS } from "../types/Configuration";
import type { GetFieldType, Paths } from "../types/Paths";

interface ConfigurationScopeValues {
scope: ConfigurationScope;
Expand Down
10 changes: 5 additions & 5 deletions packages/common/src/ide/fake/FakeIDE.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { pull } from "lodash-es";
import type { EditableTextEditor, TextEditor } from "../..";
import { GeneralizedRange } from "../../types/GeneralizedRange";
import { TextDocument } from "../../types/TextDocument";
import type { GeneralizedRange } from "../../types/GeneralizedRange";
import type { TextDocument } from "../../types/TextDocument";
import type { TextDocumentChangeEvent } from "../types/Events";
import { FlashDescriptor } from "../types/FlashDescriptor";
import { QuickPickOptions } from "../types/QuickPickOptions";
import {
import type { FlashDescriptor } from "../types/FlashDescriptor";
import type { QuickPickOptions } from "../types/QuickPickOptions";
import type {
Event,
TextEditorSelectionChangeEvent,
TextEditorVisibleRangesChangeEvent,
Expand Down
14 changes: 7 additions & 7 deletions packages/common/src/ide/normalized/NormalizedIDE.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { GeneralizedRange } from "../../types/GeneralizedRange";
import { TextEditor } from "../../types/TextEditor";
import FakeConfiguration from "../fake/FakeConfiguration";
import FakeKeyValueStore from "../fake/FakeKeyValueStore";
import { FakeIDE } from "../fake/FakeIDE";
import type { GeneralizedRange } from "../../types/GeneralizedRange";
import type { TextEditor } from "../../types/TextEditor";
import type FakeConfiguration from "../fake/FakeConfiguration";
import type FakeKeyValueStore from "../fake/FakeKeyValueStore";
import type { FakeIDE } from "../fake/FakeIDE";
import PassthroughIDEBase from "../PassthroughIDEBase";
import { FlashDescriptor } from "../types/FlashDescriptor";
import type { FlashDescriptor } from "../types/FlashDescriptor";
import type { IDE } from "../types/ide.types";
import { QuickPickOptions } from "../types/QuickPickOptions";
import type { QuickPickOptions } from "../types/QuickPickOptions";

export class NormalizedIDE extends PassthroughIDEBase {
configuration: FakeConfiguration;
Expand Down
9 changes: 5 additions & 4 deletions packages/common/src/ide/spy/SpyIDE.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { pickBy, values } from "lodash-es";
import { GeneralizedRange } from "../../types/GeneralizedRange";
import { TextEditor } from "../../types/TextEditor";
import type { GeneralizedRange } from "../../types/GeneralizedRange";
import type { TextEditor } from "../../types/TextEditor";
import PassthroughIDEBase from "../PassthroughIDEBase";
import { FlashDescriptor } from "../types/FlashDescriptor";
import type { FlashDescriptor } from "../types/FlashDescriptor";
import type { HighlightId, IDE } from "../types/ide.types";
import SpyMessages, { Message } from "./SpyMessages";
import type { Message } from "./SpyMessages";
import SpyMessages from "./SpyMessages";

interface Highlight {
highlightId: HighlightId | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/ide/types/Capabilities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CommandId } from "./CommandId";
import type { CommandId } from "./CommandId";

export interface Capabilities {
/**
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/ide/types/Configuration.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Listener } from "../..";
import type { Listener } from "../..";
import { HatStability } from "./HatStability";
import { Disposable } from "./ide.types";
import { GetFieldType, Paths } from "./Paths";
import type { Disposable } from "./ide.types";
import type { GetFieldType, Paths } from "./Paths";

export type CursorlessConfiguration = {
tokenHatSplittingMode: TokenHatSplittingMode;
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/ide/types/FileSystem.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Disposable } from "./ide.types";
import type { Disposable } from "./ide.types";

export type PathChangeListener = () => void;

Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/ide/types/FlashDescriptor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TextEditor } from "../..";
import { GeneralizedRange } from "../../types/GeneralizedRange";
import type { TextEditor } from "../..";
import type { GeneralizedRange } from "../../types/GeneralizedRange";

export enum FlashStyle {
pendingDelete = "pendingDelete",
Expand Down
8 changes: 4 additions & 4 deletions packages/common/src/ide/types/Hats.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Range } from "../../types/Range";
import { TextEditor } from "../../types/TextEditor";
import { Listener } from "../../util/Notifier";
import type { Range } from "../../types/Range";
import type { TextEditor } from "../../types/TextEditor";
import type { Listener } from "../../util/Notifier";
import type { HatStyleName } from "./hatStyles.types";
import { Disposable } from "./ide.types";
import type { Disposable } from "./ide.types";

export interface HatRange {
styleName: HatStyleName;
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/ide/types/KeyValueStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TutorialId } from "../../types/tutorial.types";
import type { TutorialId } from "../../types/tutorial.types";

interface SingleTutorialProgress {
currentStep: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Disposable } from "@cursorless/common";
import type { Disposable } from "@cursorless/common";

/**
* Provides raw tree-sitter queries. These are usually read from `.scm` files
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/ide/types/TutorialContentProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TestCaseFixtureLegacy } from "../../types/TestCaseFixture";
import { TutorialId } from "../../types/tutorial.types";
import type { TestCaseFixtureLegacy } from "../../types/TestCaseFixture";
import type { TutorialId } from "../../types/tutorial.types";

export interface TutorialContentProvider {
/**
Expand Down
22 changes: 11 additions & 11 deletions packages/common/src/ide/types/ide.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import type {
TextDocument,
TextEditor,
} from "../..";
import { URI } from "vscode-uri";
import { GeneralizedRange } from "../../types/GeneralizedRange";
import { Capabilities } from "./Capabilities";
import { Clipboard } from "./Clipboard";
import { Configuration } from "./Configuration";
import { TextDocumentChangeEvent } from "./Events";
import {
import type { URI } from "vscode-uri";
import type { GeneralizedRange } from "../../types/GeneralizedRange";
import type { Capabilities } from "./Capabilities";
import type { Clipboard } from "./Clipboard";
import type { Configuration } from "./Configuration";
import type { TextDocumentChangeEvent } from "./Events";
import type {
Event,
TextEditorSelectionChangeEvent,
TextEditorVisibleRangesChangeEvent,
} from "./events.types";
import { FlashDescriptor } from "./FlashDescriptor";
import { Messages } from "./Messages";
import { QuickPickOptions } from "./QuickPickOptions";
import { KeyValueStore } from "./KeyValueStore";
import type { FlashDescriptor } from "./FlashDescriptor";
import type { Messages } from "./Messages";
import type { QuickPickOptions } from "./QuickPickOptions";
import type { KeyValueStore } from "./KeyValueStore";

export type RunMode = "production" | "development" | "test";
export type HighlightId = string;
Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/ide/util/messages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MessageId, Messages, MessageType } from "../types/Messages";
import type { MessageId, Messages } from "../types/Messages";
import { MessageType } from "../types/Messages";

/**
* Displays a warning message {@link message} to the user along with possible
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/c.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/clojure.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/cpp.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { cScopeSupport } from "./c";
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/csharp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/css.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/go.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/html.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

const { supported, notApplicable } = ScopeSupportFacetLevel;

Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/java.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

const { supported, notApplicable } = ScopeSupportFacetLevel;

Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/javascriptreact.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { javascriptScopeSupport } from "./javascript";
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/json.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

const { supported } = ScopeSupportFacetLevel;

Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/jsonc.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { jsonScopeSupport } from "./json";
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/jsonl.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { jsonScopeSupport } from "./json";
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { rubyScopeSupport } from "./ruby";
import { rustScopeSupport } from "./rust";
import { scalaScopeSupport } from "./scala";
import { scmScopeSupport } from "./scm";
import { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { scssScopeSupport } from "./scss";
import { talonScopeSupport } from "./talon";
import { typescriptScopeSupport } from "./typescript";
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/latex.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/lua.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

const { supported, notApplicable } = ScopeSupportFacetLevel;

Expand Down
6 changes: 2 additions & 4 deletions packages/common/src/scopeSupportFacets/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
LanguageScopeSupportFacetMap,
ScopeSupportFacetLevel,
} from "./scopeSupportFacets.types";
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types";
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
Expand Down
Loading
Loading