Set verbatimModuleSyntax for server code
The nuxi typecheck command complains about type only imports that are not declared as such, but the VsCode environment does not. There's probably a missmatch somewhere in the configuration for Nuxt that I'm not going to dig into. Workaround this issue for now by setting the option in the tsconfig.json file for the server.
This commit is contained in:
parent
0d0e38e4b6
commit
f69381c44c
4 changed files with 8 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
import { readUsers, writeUsers, nextUserId, type ServerUser, readAuthenticationMethods, nextAuthenticationMethodId, writeAuthenticationMethods } from "~/server/database";
|
||||
import { broadcastEvent } from "~/server/streams";
|
||||
import { ApiSession } from "~/shared/types/api";
|
||||
import type { ApiSession } from "~/shared/types/api";
|
||||
|
||||
export default defineEventHandler(async (event): Promise<ApiSession> => {
|
||||
let session = await getServerSession(event, false);
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
*/
|
||||
import * as fs from "node:fs/promises";
|
||||
import type { H3Event } from "h3";
|
||||
import { string, z } from "zod/v4-mini";
|
||||
import { z } from "zod/v4-mini";
|
||||
import { readAuthenticationMethods, readUsers } from "~/server/database";
|
||||
import { type TelegramAuthData, telegramAuthDataSchema } from "~/shared/types/telegram";
|
||||
import { ApiSession } from "~/shared/types/api";
|
||||
import type { ApiSession } from "~/shared/types/api";
|
||||
|
||||
const loginSchema = z.object({
|
||||
authData: telegramAuthDataSchema,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
import { readUsers, ServerSession } from "~/server/database";
|
||||
import { readUsers, type ServerSession } from "~/server/database";
|
||||
import type { ApiAccount, ApiEvent } from "~/shared/types/api";
|
||||
import { serverSessionToApi } from "./utils/session";
|
||||
import { H3Event } from "h3";
|
||||
|
|
|
@ -3,5 +3,8 @@
|
|||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
{
|
||||
"extends": "../.nuxt/tsconfig.server.json"
|
||||
"extends": "../.nuxt/tsconfig.server.json",
|
||||
"compilerOptions": {
|
||||
"verbatimModuleSyntax": true,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue