Set verbatimModuleSyntax for server code
Some checks failed
/ build (push) Failing after 28s
/ deploy (push) Has been skipped

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:
Hornwitser 2025-07-09 18:08:39 +02:00
parent 0d0e38e4b6
commit f69381c44c
4 changed files with 8 additions and 5 deletions

View file

@ -4,7 +4,7 @@
*/ */
import { readUsers, writeUsers, nextUserId, type ServerUser, readAuthenticationMethods, nextAuthenticationMethodId, writeAuthenticationMethods } from "~/server/database"; import { readUsers, writeUsers, nextUserId, type ServerUser, readAuthenticationMethods, nextAuthenticationMethodId, writeAuthenticationMethods } from "~/server/database";
import { broadcastEvent } from "~/server/streams"; 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> => { export default defineEventHandler(async (event): Promise<ApiSession> => {
let session = await getServerSession(event, false); let session = await getServerSession(event, false);

View file

@ -4,10 +4,10 @@
*/ */
import * as fs from "node:fs/promises"; import * as fs from "node:fs/promises";
import type { H3Event } from "h3"; 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 { readAuthenticationMethods, readUsers } from "~/server/database";
import { type TelegramAuthData, telegramAuthDataSchema } from "~/shared/types/telegram"; 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({ const loginSchema = z.object({
authData: telegramAuthDataSchema, authData: telegramAuthDataSchema,

View file

@ -2,7 +2,7 @@
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no> SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
SPDX-License-Identifier: AGPL-3.0-or-later 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 type { ApiAccount, ApiEvent } from "~/shared/types/api";
import { serverSessionToApi } from "./utils/session"; import { serverSessionToApi } from "./utils/session";
import { H3Event } from "h3"; import { H3Event } from "h3";

View file

@ -3,5 +3,8 @@
SPDX-License-Identifier: AGPL-3.0-or-later SPDX-License-Identifier: AGPL-3.0-or-later
*/ */
{ {
"extends": "../.nuxt/tsconfig.server.json" "extends": "../.nuxt/tsconfig.server.json",
"compilerOptions": {
"verbatimModuleSyntax": true,
},
} }