fix(kit): improve generated tsconfig.json defaults (#23121)

This commit is contained in:
Daniel Roe 2023-09-11 14:40:36 +01:00 committed by GitHub
parent 63d189a0c7
commit f79f9b3a60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,6 +117,7 @@ export async function writeTypes (nuxt: Nuxt) {
compilerOptions: { compilerOptions: {
forceConsistentCasingInFileNames: true, forceConsistentCasingInFileNames: true,
jsx: 'preserve', jsx: 'preserve',
jsxImportSource: 'vue',
target: 'ESNext', target: 'ESNext',
module: 'ESNext', module: 'ESNext',
moduleResolution: nuxt.options.experimental?.typescriptBundlerResolution ? 'Bundler' : 'Node', moduleResolution: nuxt.options.experimental?.typescriptBundlerResolution ? 'Bundler' : 'Node',
@ -124,6 +125,11 @@ export async function writeTypes (nuxt: Nuxt) {
isolatedModules: true, isolatedModules: true,
useDefineForClassFields: true, useDefineForClassFields: true,
strict: nuxt.options.typescript?.strict ?? true, strict: nuxt.options.typescript?.strict ?? true,
noImplicitThis: true,
esModuleInterop: true,
// TODO: enable by default in v3.8
// types: [],
// verbatimModuleSyntax: true,
allowJs: true, allowJs: true,
noEmit: true, noEmit: true,
resolveJsonModule: true, resolveJsonModule: true,