Skip to content

Commit 6b87f2f

Browse files
consistent-type-imports rule (#2619)
related #2618 revives #1832 vscode quick fix import and auto import appears to be doing the right thing in regards to type only or runtime imports. Imports organize or imports fix unfortunately do not convert a runtime import to a type import if it's only used as a type. We probably need to rely on the linter to do that part for us. ## Checklist - [/] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 6022ac2 commit 6b87f2f

File tree

532 files changed

+1520
-1528
lines changed

Some content is hidden

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

532 files changed

+1520
-1528
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
],
2424
"rules": {
2525
"import/no-relative-packages": "error",
26+
"@typescript-eslint/consistent-type-imports": "error",
2627
"@typescript-eslint/consistent-type-assertions": [
2728
"error",
2829
{

packages/cheatsheet-local/src/app/app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { CheatsheetPage, CheatsheetInfo } from "@cursorless/cheatsheet";
1+
import type { CheatsheetInfo } from "@cursorless/cheatsheet";
2+
import { CheatsheetPage } from "@cursorless/cheatsheet";
23
import "../styles.css";
34

45
declare global {

packages/cheatsheet/src/lib/cheatsheet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
66
import { faCircleQuestion } from "@fortawesome/free-solid-svg-icons/faCircleQuestion";
77
import CheatsheetNotesComponent from "./components/CheatsheetNotesComponent";
88
import SmartLink from "./components/SmartLink";
9-
import { CheatsheetInfo } from "./CheatsheetInfo";
9+
import type { CheatsheetInfo } from "./CheatsheetInfo";
1010

1111
type CheatsheetPageProps = {
1212
cheatsheetInfo: CheatsheetInfo;

packages/cheatsheet/src/lib/components/CheatsheetLegendComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { CheatsheetLegend } from "../cheatsheetLegend";
2+
import type { CheatsheetLegend } from "../cheatsheetLegend";
33
import useIsHighlighted from "../hooks/useIsHighlighted";
44
import { formatCaptures } from "./formatCaptures";
55
import SmartLink from "./SmartLink";

packages/cheatsheet/src/lib/components/CheatsheetListComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CheatsheetSection, Variation } from "../CheatsheetInfo";
1+
import type { CheatsheetSection, Variation } from "../CheatsheetInfo";
22
import useIsHighlighted from "../hooks/useIsHighlighted";
33
import { formatCaptures } from "./formatCaptures";
44

packages/common/src/FakeCommandServerApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {
1+
import type {
22
CommandServerApi,
33
FocusedElementType,
44
InboundSignal,

packages/common/src/ide/fake/FakeCapabilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Capabilities } from "../types/Capabilities";
1+
import type { Capabilities } from "../types/Capabilities";
22

33
export class FakeCapabilities implements Capabilities {
44
commands = {

packages/common/src/ide/fake/FakeConfiguration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { get } from "lodash-es";
22
import { Notifier } from "../../util/Notifier";
3-
import {
3+
import type {
44
Configuration,
55
ConfigurationScope,
6-
CONFIGURATION_DEFAULTS,
76
CursorlessConfigKey,
87
CursorlessConfiguration,
98
} from "../types/Configuration";
10-
import { GetFieldType, Paths } from "../types/Paths";
9+
import { CONFIGURATION_DEFAULTS } from "../types/Configuration";
10+
import type { GetFieldType, Paths } from "../types/Paths";
1111

1212
interface ConfigurationScopeValues {
1313
scope: ConfigurationScope;

packages/common/src/ide/fake/FakeIDE.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { pull } from "lodash-es";
22
import type { EditableTextEditor, TextEditor } from "../..";
3-
import { GeneralizedRange } from "../../types/GeneralizedRange";
4-
import { TextDocument } from "../../types/TextDocument";
3+
import type { GeneralizedRange } from "../../types/GeneralizedRange";
4+
import type { TextDocument } from "../../types/TextDocument";
55
import type { TextDocumentChangeEvent } from "../types/Events";
6-
import { FlashDescriptor } from "../types/FlashDescriptor";
7-
import { QuickPickOptions } from "../types/QuickPickOptions";
8-
import {
6+
import type { FlashDescriptor } from "../types/FlashDescriptor";
7+
import type { QuickPickOptions } from "../types/QuickPickOptions";
8+
import type {
99
Event,
1010
TextEditorSelectionChangeEvent,
1111
TextEditorVisibleRangesChangeEvent,

packages/common/src/ide/normalized/NormalizedIDE.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { GeneralizedRange } from "../../types/GeneralizedRange";
2-
import { TextEditor } from "../../types/TextEditor";
3-
import FakeConfiguration from "../fake/FakeConfiguration";
4-
import FakeKeyValueStore from "../fake/FakeKeyValueStore";
5-
import { FakeIDE } from "../fake/FakeIDE";
1+
import type { GeneralizedRange } from "../../types/GeneralizedRange";
2+
import type { TextEditor } from "../../types/TextEditor";
3+
import type FakeConfiguration from "../fake/FakeConfiguration";
4+
import type FakeKeyValueStore from "../fake/FakeKeyValueStore";
5+
import type { FakeIDE } from "../fake/FakeIDE";
66
import PassthroughIDEBase from "../PassthroughIDEBase";
7-
import { FlashDescriptor } from "../types/FlashDescriptor";
7+
import type { FlashDescriptor } from "../types/FlashDescriptor";
88
import type { IDE } from "../types/ide.types";
9-
import { QuickPickOptions } from "../types/QuickPickOptions";
9+
import type { QuickPickOptions } from "../types/QuickPickOptions";
1010

1111
export class NormalizedIDE extends PassthroughIDEBase {
1212
configuration: FakeConfiguration;

0 commit comments

Comments
 (0)