mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
test: replace stale lint suppressions with type imports
This commit is contained in:
4 files changed
+8
-11
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-imports */
|
||||
import type * as RoomsNotificationPreferencesModule from '$hooks/useRoomsNotificationPreferences';
|
||||
|
||||
import { RoomNotificationMode } from '$hooks/useRoomsNotificationPreferences';
|
||||
|
||||
@@ -13,7 +12,7 @@ const { mockSetMode, modeStateStatus } = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock('$hooks/useRoomsNotificationPreferences', async () => {
|
||||
const actual = await vi.importActual<typeof import('$hooks/useRoomsNotificationPreferences')>(
|
||||
const actual = await vi.importActual<typeof RoomsNotificationPreferencesModule>(
|
||||
'$hooks/useRoomsNotificationPreferences'
|
||||
);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-imports */
|
||||
import type * as ThemeModule from '$hooks/useTheme';
|
||||
|
||||
import { Appearance } from './Themes';
|
||||
|
||||
@@ -42,7 +41,7 @@ vi.mock('$state/hooks/settings', () => ({
|
||||
}));
|
||||
|
||||
vi.mock('$hooks/useTheme', async () => {
|
||||
const actual = await vi.importActual<typeof import('$hooks/useTheme')>('$hooks/useTheme');
|
||||
const actual = await vi.importActual<typeof ThemeModule>('$hooks/useTheme');
|
||||
|
||||
return {
|
||||
...actual,
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-imports */
|
||||
import type * as Arborium from '@arborium/arborium';
|
||||
|
||||
import type { HighlightResult } from '.';
|
||||
|
||||
type ArboriumModule = typeof import('@arborium/arborium');
|
||||
type ArboriumModule = typeof Arborium;
|
||||
|
||||
afterEach(() => {
|
||||
vi.resetModules();
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import type { MatrixClient } from '$types/matrix-sdk';
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-imports */
|
||||
import { SlidingSyncManager, type SlidingSyncConfig } from './slidingSync';
|
||||
|
||||
// ── vi.hoisted mocks ─────────────────────────────────────────────────────────
|
||||
@@ -77,7 +77,7 @@ function makeMockMx(overrides: Record<string, unknown> = {}) {
|
||||
off: vi.fn<() => void>(),
|
||||
removeListener: vi.fn<() => void>(),
|
||||
...overrides,
|
||||
} as unknown as import('$types/matrix-sdk').MatrixClient;
|
||||
} as unknown as MatrixClient;
|
||||
}
|
||||
|
||||
function makeManager(mx: ReturnType<typeof makeMockMx>): SlidingSyncManager {
|
||||
|
||||
Reference in new issue
Block a user