chore: Enforce consistent type imports via @typescript-eslint/consistent-type-imports (#2545)
This commit is contained in:
committed by
dermotduffy
parent
8f4ebcc0de
commit
7dc29865b8
@@ -2,10 +2,10 @@ import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { getViewMediaFromBrowseMediaArray } from '../../../src/ha/browse-media/browse-media-to-view-media';
|
||||
import {
|
||||
BrowseMediaMetadata,
|
||||
MEDIA_CLASS_IMAGE,
|
||||
MEDIA_CLASS_VIDEO,
|
||||
RichBrowseMedia,
|
||||
type BrowseMediaMetadata,
|
||||
type RichBrowseMedia,
|
||||
} from '../../../src/ha/browse-media/types';
|
||||
import { createBrowseMedia, createRichBrowseMedia } from '../../test-utils';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { sortMostRecentFirst } from '../../../src/ha/browse-media/sort';
|
||||
import {
|
||||
import type {
|
||||
BrowseMediaMetadata,
|
||||
RichBrowseMedia,
|
||||
} from '../../../src/ha/browse-media/types';
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import {
|
||||
BrowseMedia,
|
||||
BrowseMediaCache,
|
||||
browseMediaSchema,
|
||||
RichBrowseMedia,
|
||||
type BrowseMedia,
|
||||
type RichBrowseMedia,
|
||||
} from '../../../src/ha/browse-media/types';
|
||||
import { BrowseMediaStep, BrowseMediaWalker } from '../../../src/ha/browse-media/walker';
|
||||
import {
|
||||
BrowseMediaWalker,
|
||||
type BrowseMediaStep,
|
||||
} from '../../../src/ha/browse-media/walker';
|
||||
import { homeAssistantWSRequest } from '../../../src/ha/ws-request';
|
||||
import { createBrowseMedia, createHASS } from '../../test-utils';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { SubscriptionHealthMonitor } from '../../../src/ha/connection/subscription-health-monitor';
|
||||
import { HASSWebSocketSubscriptionStatus } from '../../../src/ha/connection/subscription-manager';
|
||||
import type { HASSWebSocketSubscriptionStatus } from '../../../src/ha/connection/subscription-manager';
|
||||
|
||||
interface TestRequest {
|
||||
id: string;
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
import { Connection, STATE_RUNNING, STATE_STARTING } from 'home-assistant-js-websocket';
|
||||
import {
|
||||
STATE_RUNNING,
|
||||
STATE_STARTING,
|
||||
type Connection,
|
||||
} from 'home-assistant-js-websocket';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import {
|
||||
HASSConnectionSubscriptionManager,
|
||||
HASSWebSocketStatusCallback,
|
||||
HASSWebSocketSubscriptionStatus,
|
||||
type HASSWebSocketStatusCallback,
|
||||
type HASSWebSocketSubscriptionStatus,
|
||||
} from '../../../src/ha/connection/subscription-manager';
|
||||
import {
|
||||
import type {
|
||||
HASSWebSocketLiveness,
|
||||
HASSWebSocketOpenCallback,
|
||||
} from '../../../src/ha/connection/types';
|
||||
import { HASSSource } from '../../../src/ha/source';
|
||||
import type { HASSSource } from '../../../src/ha/source';
|
||||
import {
|
||||
createHASS,
|
||||
createHASSSource,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import { getMediaDownloadPath } from '../../src/ha/download';
|
||||
import { ResolvedMediaCache, resolveMedia } from '../../src/ha/resolved-media.js';
|
||||
import { resolveMedia, type ResolvedMediaCache } from '../../src/ha/resolved-media.js';
|
||||
import { createHASS } from '../test-utils';
|
||||
|
||||
vi.mock('../../src/ha/canonical-url.js', () => ({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HassEventBase } from 'home-assistant-js-websocket';
|
||||
import type { HassEventBase } from 'home-assistant-js-websocket';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { matchesEventContext, matchesEventData } from '../../src/ha/event-match';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
||||
|
||||
import { homeAssistantSignAndFetch } from '../../src/ha/fetch';
|
||||
import { homeAssistantGetSignedURLIfNecessary } from '../../src/ha/sign-path';
|
||||
import { AdvancedCameraCardError, Endpoint } from '../../src/types';
|
||||
import type { AdvancedCameraCardError, Endpoint } from '../../src/types';
|
||||
import { createHASS } from '../test-utils';
|
||||
|
||||
vi.mock('../../src/ha/sign-path');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { fireHASSEvent } from '../../src/ha/fire-hass-event.js';
|
||||
import { forwardHaptic, HapticType } from '../../src/ha/haptic.js';
|
||||
import { forwardHaptic, type HapticType } from '../../src/ha/haptic.js';
|
||||
|
||||
vi.mock('../../src/ha/fire-hass-event.js', () => ({
|
||||
fireHASSEvent: vi.fn(),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {
|
||||
Entity,
|
||||
EntityCache,
|
||||
EntityRegistryManager,
|
||||
type Entity,
|
||||
type EntityRegistryManager,
|
||||
} from '../../../../src/ha/registry/entity/types';
|
||||
import { HomeAssistant } from '../../../../src/ha/types';
|
||||
import type { HomeAssistant } from '../../../../src/ha/types';
|
||||
|
||||
export class EntityRegistryManagerMock implements EntityRegistryManager {
|
||||
private _cache = new EntityCache();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { ResolvedMediaCache, resolveMedia } from '../../src/ha/resolved-media';
|
||||
import { ResolvedMedia, resolvedMediaSchema } from '../../src/ha/types';
|
||||
import { resolvedMediaSchema, type ResolvedMedia } from '../../src/ha/types';
|
||||
import { homeAssistantWSRequest } from '../../src/ha/ws-request';
|
||||
import { errorToConsole } from '../../src/utils/basic';
|
||||
import { createHASS } from '../test-utils';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { EnabledProxyConfig } from '../../src/config/schema/common/proxy.js';
|
||||
import type { EnabledProxyConfig } from '../../src/config/schema/common/proxy.js';
|
||||
import {
|
||||
addDynamicProxyURL,
|
||||
createProxiedEndpointIfNecessary,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { ResolvedMedia, resolvedMediaSchema } from '../../src/ha/types';
|
||||
import { resolvedMediaSchema, type ResolvedMedia } from '../../src/ha/types';
|
||||
import { homeAssistantWSRequest } from '../../src/ha/ws-request';
|
||||
import { createHASS } from '../test-utils';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user