From 86520bd0ec5e88d67779106204aa858b406469d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kevin=20Deng=20=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?=
 <sxzz@sxzz.moe>
Date: Wed, 5 Mar 2025 00:32:01 +0800
Subject: [PATCH] fix(schema): use `RawVueCompilerOptions` for unresolved
 `tsconfig` (#31202)

---
 packages/schema/src/config/typescript.ts | 2 +-
 packages/schema/src/types/hooks.ts       | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/packages/schema/src/config/typescript.ts b/packages/schema/src/config/typescript.ts
index fb020816ca..a24938f237 100644
--- a/packages/schema/src/config/typescript.ts
+++ b/packages/schema/src/config/typescript.ts
@@ -84,7 +84,7 @@ export default defineResolvers({
 
     /**
      * You can extend generated `.nuxt/tsconfig.json` using this option.
-     * @type {0 extends 1 & VueCompilerOptions ? typeof import('pkg-types')['TSConfig'] : typeof import('pkg-types')['TSConfig'] & { vueCompilerOptions?: Omit<typeof import('@vue/language-core')['VueCompilerOptions'], 'plugins'> & { plugins?: string[] } }}
+     * @type {0 extends 1 & RawVueCompilerOptions ? typeof import('pkg-types')['TSConfig'] : typeof import('pkg-types')['TSConfig'] & { vueCompilerOptions?: typeof import('@vue/language-core')['RawVueCompilerOptions'] }}
      */
     tsConfig: {},
 
diff --git a/packages/schema/src/types/hooks.ts b/packages/schema/src/types/hooks.ts
index 7d06c6cf3a..8517afaef4 100644
--- a/packages/schema/src/types/hooks.ts
+++ b/packages/schema/src/types/hooks.ts
@@ -9,7 +9,7 @@ import type { Compiler, Configuration, Stats } from 'webpack'
 import type { Nitro, NitroConfig } from 'nitropack'
 import type { Schema, SchemaDefinition } from 'untyped'
 import type { RouteLocationRaw, RouteRecordRaw } from 'vue-router'
-import type { VueCompilerOptions } from '@vue/language-core'
+import type { RawVueCompilerOptions } from '@vue/language-core'
 import type { NuxtCompatibility, NuxtCompatibilityIssues, ViteConfig } from '..'
 import type { Component, ComponentsOptions } from './components'
 import type { Nuxt, NuxtApp, ResolvedNuxtTemplate } from './nuxt'
@@ -21,9 +21,9 @@ export type TSReference = { types: string } | { path: string }
 
 export type WatchEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'
 
-// If the user does not have `@vue/language-core` installed, VueCompilerOptions will be typed as `any`,
-// thus making the whole `VueTSConfig` type `any`. We only augment TSConfig if VueCompilerOptions is available.
-export type VueTSConfig = 0 extends 1 & VueCompilerOptions ? TSConfig : TSConfig & { vueCompilerOptions?: Omit<VueCompilerOptions, 'plugins'> & { plugins?: string[] } }
+// If the user does not have `@vue/language-core` installed, RawVueCompilerOptions will be typed as `any`,
+// thus making the whole `VueTSConfig` type `any`. We only augment TSConfig if RawVueCompilerOptions is available.
+export type VueTSConfig = 0 extends 1 & RawVueCompilerOptions ? TSConfig : TSConfig & { vueCompilerOptions?: RawVueCompilerOptions }
 
 export type NuxtPage = {
   name?: string