Bump TypeScript to 5.3 with verbatimModuleSyntax

This commit upgrades TypeScript to the latest version 5.3 and introduces
`verbatimModuleSyntax` in line with the official Vue guide
recommendatinos (vuejs/docs#2592).

By enforcing `import type` for type-only imports, this commit improves
code clarity and supports tooling optimization, ensuring imports are
only bundled when necessary for runtime.

Changes:

- Bump TypeScript to 5.3.3 across the project.
- Adjust import statements to utilize `import type` where applicable,
  promoting cleaner and more efficient code.
This commit is contained in:
undergroundwires
2024-02-27 04:20:22 +01:00
parent 98845e6cae
commit a721e82a4f
541 changed files with 1187 additions and 1184 deletions

View File

@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest';
import {
AnimationFunction, TRANSITION_DURATION_MILLISECONDS,
useExpandCollapseAnimation, MutatedStyleProperties,
type AnimationFunction, TRANSITION_DURATION_MILLISECONDS,
useExpandCollapseAnimation, type MutatedStyleProperties,
} from '@/presentation/components/Shared/ExpandCollapse/UseExpandCollapseAnimation';
import { TimerStub } from '@tests/unit/shared/Stubs/TimerStub';
import { watchPromiseState, flushPromiseResolutionQueue } from '@tests/unit/shared/PromiseInspection';

View File

@@ -3,7 +3,7 @@ import {
} from 'vitest';
import { shallowMount } from '@vue/test-utils';
import FlatButton from '@/presentation/components/Shared/FlatButton.vue';
import { IconName } from '@/presentation/components/Shared/Icon/IconName';
import type { IconName } from '@/presentation/components/Shared/Icon/IconName';
import AppIcon from '@/presentation/components/Shared/Icon/AppIcon.vue';
import { formatAssertionMessage } from '@tests/shared/FormatAssertionMessage';
import { hasDirective } from '@/presentation/components/Scripts/View/Cards/NonCollapsingDirective';

View File

@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import { BrowserClipboard, NavigatorClipboard } from '@/presentation/components/Shared/Hooks/Clipboard/BrowserClipboard';
import { BrowserClipboard, type NavigatorClipboard } from '@/presentation/components/Shared/Hooks/Clipboard/BrowserClipboard';
import { StubWithObservableMethodCalls } from '@tests/unit/shared/Stubs/StubWithObservableMethodCalls';
import { expectThrowsAsync } from '@tests/shared/Assertions/ExpectThrowsAsync';
import { expectExists } from '@tests/shared/Assertions/ExpectExists';

View File

@@ -2,7 +2,7 @@ import { describe, it, expect } from 'vitest';
import { useClipboard } from '@/presentation/components/Shared/Hooks/Clipboard/UseClipboard';
import { BrowserClipboard } from '@/presentation/components/Shared/Hooks/Clipboard/BrowserClipboard';
import { ClipboardStub } from '@tests/unit/shared/Stubs/ClipboardStub';
import { FunctionKeys } from '@/TypeHelpers';
import type { FunctionKeys } from '@/TypeHelpers';
import { expectExists } from '@tests/shared/Assertions/ExpectExists';
describe('useClipboard', () => {

View File

@@ -1,13 +1,13 @@
import { describe, it, expect } from 'vitest';
import {
createEnvironmentSpecificLoggedDialog, WindowDialogCreationFunction,
BrowserDialogCreationFunction, DialogLoggingDecorator,
createEnvironmentSpecificLoggedDialog, type WindowDialogCreationFunction,
type BrowserDialogCreationFunction, type DialogLoggingDecorator,
} from '@/presentation/components/Shared/Hooks/Dialog/ClientDialogFactory';
import { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
import type { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
import { RuntimeEnvironmentStub } from '@tests/unit/shared/Stubs/RuntimeEnvironmentStub';
import { DialogStub } from '@tests/unit/shared/Stubs/DialogStub';
import { collectExceptionMessage } from '@tests/unit/shared/ExceptionCollector';
import { Dialog } from '@/presentation/common/Dialog';
import type { Dialog } from '@/presentation/common/Dialog';
describe('ClientDialogFactory', () => {
describe('createEnvironmentSpecificLoggedDialog', () => {

View File

@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import { DialogFactory, useDialog } from '@/presentation/components/Shared/Hooks/Dialog/UseDialog';
import { type DialogFactory, useDialog } from '@/presentation/components/Shared/Hooks/Dialog/UseDialog';
import { DialogStub } from '@tests/unit/shared/Stubs/DialogStub';
describe('UseDialog', () => {

View File

@@ -1,11 +1,11 @@
// eslint-disable-next-line max-classes-per-file
import { describe, it } from 'vitest';
import { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
import { Logger } from '@/application/Common/Log/Logger';
import type { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
import type { Logger } from '@/application/Common/Log/Logger';
import { RuntimeEnvironmentStub } from '@tests/unit/shared/Stubs/RuntimeEnvironmentStub';
import { itIsSingleton } from '@tests/unit/shared/TestCases/SingletonTests';
import { LoggerStub } from '@tests/unit/shared/Stubs/LoggerStub';
import { ClientLoggerFactory, LoggerCreationFunction, WindowAccessor } from '@/presentation/components/Shared/Hooks/Log/ClientLoggerFactory';
import { ClientLoggerFactory, type LoggerCreationFunction, type WindowAccessor } from '@/presentation/components/Shared/Hooks/Log/ClientLoggerFactory';
describe('ClientLoggerFactory', () => {
describe('Current', () => {

View File

@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest';
import { LoggerStub } from '@tests/unit/shared/Stubs/LoggerStub';
import { useLogger } from '@/presentation/components/Shared/Hooks/Log/UseLogger';
import { LoggerFactory } from '@/presentation/components/Shared/Hooks/Log/LoggerFactory';
import type { LoggerFactory } from '@/presentation/components/Shared/Hooks/Log/LoggerFactory';
describe('UseLogger', () => {
it('returns expected logger from factory', () => {

View File

@@ -4,7 +4,7 @@ import { useAutoUnsubscribedEvents } from '@/presentation/components/Shared/Hook
import { EventSubscriptionCollectionStub } from '@tests/unit/shared/Stubs/EventSubscriptionCollectionStub';
import { EventSubscriptionStub } from '@tests/unit/shared/Stubs/EventSubscriptionStub';
import { EventSubscriptionCollection } from '@/infrastructure/Events/EventSubscriptionCollection';
import { FunctionKeys } from '@/TypeHelpers';
import type { FunctionKeys } from '@/TypeHelpers';
describe('UseAutoUnsubscribedEvents', () => {
describe('event collection handling', () => {

View File

@@ -2,11 +2,11 @@ import { describe, it, expect } from 'vitest';
import { useCollectionState } from '@/presentation/components/Shared/Hooks/UseCollectionState';
import { CategoryCollectionStateStub } from '@tests/unit/shared/Stubs/CategoryCollectionStateStub';
import { ApplicationContextStub } from '@tests/unit/shared/Stubs/ApplicationContextStub';
import { IReadOnlyCategoryCollectionState } from '@/application/Context/State/ICategoryCollectionState';
import type { IReadOnlyCategoryCollectionState } from '@/application/Context/State/ICategoryCollectionState';
import { ApplicationContextChangedEventStub } from '@tests/unit/shared/Stubs/ApplicationContextChangedEventStub';
import { OperatingSystem } from '@/domain/OperatingSystem';
import { IApplicationContext } from '@/application/Context/IApplicationContext';
import { IEventSubscriptionCollection } from '@/infrastructure/Events/IEventSubscriptionCollection';
import type { IApplicationContext } from '@/application/Context/IApplicationContext';
import type { IEventSubscriptionCollection } from '@/infrastructure/Events/IEventSubscriptionCollection';
import { EventSubscriptionCollectionStub } from '@tests/unit/shared/Stubs/EventSubscriptionCollectionStub';
describe('UseCollectionState', () => {

View File

@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import { IEventSubscriptionCollection } from '@/infrastructure/Events/IEventSubscriptionCollection';
import type { IEventSubscriptionCollection } from '@/infrastructure/Events/IEventSubscriptionCollection';
import { useCurrentCode } from '@/presentation/components/Shared/Hooks/UseCurrentCode';
import { ApplicationCodeStub } from '@tests/unit/shared/Stubs/ApplicationCodeStub';
import { CategoryCollectionStateStub } from '@tests/unit/shared/Stubs/CategoryCollectionStateStub';

View File

@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest';
import { useScriptDiagnosticsCollector } from '@/presentation/components/Shared/Hooks/UseScriptDiagnosticsCollector';
import { ScriptDiagnosticsCollectorStub } from '@tests/unit/shared/Stubs/ScriptDiagnosticsCollectorStub';
import { WindowVariables } from '@/infrastructure/WindowVariables/WindowVariables';
import type { WindowVariables } from '@/infrastructure/WindowVariables/WindowVariables';
describe('useScriptDiagnosticsCollector', () => {
it('returns undefined if collector is not present on the window object', () => {

View File

@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest';
import { nextTick, watch } from 'vue';
import { SelectionModifier, useUserSelectionState } from '@/presentation/components/Shared/Hooks/UseUserSelectionState';
import { UserSelection } from '@/application/Context/State/Selection/UserSelection';
import { type SelectionModifier, useUserSelectionState } from '@/presentation/components/Shared/Hooks/UseUserSelectionState';
import type { UserSelection } from '@/application/Context/State/Selection/UserSelection';
import { UseCollectionStateStub } from '@tests/unit/shared/Stubs/UseCollectionStateStub';
import { UseAutoUnsubscribedEventsStub } from '@tests/unit/shared/Stubs/UseAutoUnsubscribedEventsStub';
import { UserSelectionStub } from '@tests/unit/shared/Stubs/UserSelectionStub';

View File

@@ -4,7 +4,7 @@ import {
import { shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import AppIcon from '@/presentation/components/Shared/Icon/AppIcon.vue';
import { IconName } from '@/presentation/components/Shared/Icon/IconName';
import type { IconName } from '@/presentation/components/Shared/Icon/IconName';
import { UseSvgLoaderStub } from '@tests/unit/shared/Stubs/UseSvgLoaderStub';
import { formatAssertionMessage } from '@tests/shared/FormatAssertionMessage';

View File

@@ -2,8 +2,8 @@ import {
describe, it, expect, beforeEach,
} from 'vitest';
import { ref } from 'vue';
import { IconName } from '@/presentation/components/Shared/Icon/IconName';
import { FileLoaders, clearIconCache, useSvgLoader } from '@/presentation/components/Shared/Icon/UseSvgLoader';
import type { IconName } from '@/presentation/components/Shared/Icon/IconName';
import { type FileLoaders, clearIconCache, useSvgLoader } from '@/presentation/components/Shared/Icon/UseSvgLoader';
import { waitForValueChange } from '@tests/shared/WaitForValueChange';
describe('useSvgLoader', () => {

View File

@@ -2,8 +2,8 @@ import { describe, it, expect } from 'vitest';
import { shallowMount } from '@vue/test-utils';
import { ref, nextTick, defineComponent } from 'vue';
import { useLockBodyBackgroundScroll } from '@/presentation/components/Shared/Modal/Hooks/ScrollLock/UseLockBodyBackgroundScroll';
import { ScrollDomStateAccessor } from '@/presentation/components/Shared/Modal/Hooks/ScrollLock/ScrollDomStateAccessor';
import { PropertyKeys } from '@/TypeHelpers';
import type { ScrollDomStateAccessor } from '@/presentation/components/Shared/Modal/Hooks/ScrollLock/ScrollDomStateAccessor';
import type { PropertyKeys } from '@/TypeHelpers';
describe('useLockBodyBackgroundScroll', () => {
describe('initialization', () => {

View File

@@ -4,7 +4,7 @@ import {
import { shallowMount } from '@vue/test-utils';
import { nextTick, defineComponent } from 'vue';
import { useEscapeKeyListener } from '@/presentation/components/Shared/Modal/Hooks/UseEscapeKeyListener';
import { EventName, createWindowEventSpies } from '@tests/shared/Spies/WindowEventSpies';
import { type EventName, createWindowEventSpies } from '@tests/shared/Spies/WindowEventSpies';
describe('useEscapeKeyListener', () => {
it('executes the callback when the Escape key is pressed', async () => {