From 7b37d1da886db37549277012a0203495e90efec3 Mon Sep 17 00:00:00 2001 From: Nils Minten Date: Tue, 23 Jan 2024 14:22:18 +0100 Subject: [PATCH 1/2] Fix TypeScript error when `verbatimModuleSyntax` is enabled When `verbatimModuleSyntax` is enabled in TypeScript when building your application two Type errors would pop up. ```console TS1484: 'RoutesMap' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. ``` ```console TS1484: 'Route' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. ``` --- Resources/ts/router.test-d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/ts/router.test-d.ts b/Resources/ts/router.test-d.ts index e9aadf7..862f183 100644 --- a/Resources/ts/router.test-d.ts +++ b/Resources/ts/router.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; -import { RoutesMap } from '../js/router'; -import { Route, Router, Routing } from './router'; +import type { RoutesMap } from '../js/router'; +import { Route, Router, type Routing } from './router'; import routes from './routes.json'; expectType(Router.getInstance()); From 3cfe2cd331bfb2d3e850a243bd83f819db3ac253 Mon Sep 17 00:00:00 2001 From: Nils Minten Date: Tue, 23 Jan 2024 14:53:01 +0100 Subject: [PATCH 2/2] Actually change the correct import --- Resources/ts/router.test-d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/ts/router.test-d.ts b/Resources/ts/router.test-d.ts index 862f183..4b65185 100644 --- a/Resources/ts/router.test-d.ts +++ b/Resources/ts/router.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd'; import type { RoutesMap } from '../js/router'; -import { Route, Router, type Routing } from './router'; +import { type Route, Router, Routing } from './router'; import routes from './routes.json'; expectType(Router.getInstance());