From 7da15a1d66721bec24bc1d8a9a7dacbb3b146b83 Mon Sep 17 00:00:00 2001 From: Mark Kowit Date: Wed, 30 Apr 2025 19:53:36 -0400 Subject: [PATCH] docs: comment TypeScript errors in app.ts and tsconfig.json --- resources/js/app.ts | 4 ++++ tsconfig.json | 3 +++ 2 files changed, 7 insertions(+) diff --git a/resources/js/app.ts b/resources/js/app.ts index 5670d9e8..12ce0682 100644 --- a/resources/js/app.ts +++ b/resources/js/app.ts @@ -7,6 +7,10 @@ import { createApp, h } from 'vue'; import { ZiggyVue } from 'ziggy-js'; import { initializeTheme } from './composables/useAppearance'; +// VS Code warning: "File 'vite/client.d.ts' is not a module" (TS2306) +// This import is still safe to use for type support in Vite projects. +// See related Vite issue: https://github.com/vitejs/vite/issues/5370 + // Extend ImportMeta interface for Vite... declare module 'vite/client' { interface ImportMetaEnv { diff --git a/tsconfig.json b/tsconfig.json index b404281d..2c861a02 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -39,11 +39,14 @@ }, // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + + // "types": ["vue/tsx"] // Causes warning if '@vue/tsx-jsx' is not installed, which it appears is not installed by default "types": [ "vite/client", "vue/tsx", "./resources/js/types" ] /* Specify type package names to be included without being referenced in a source file. */, + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */