Vite · VITE0011
Type Vite environment variables
Flags untyped env in Vite env code before it leaks into runtime behavior.
Run this rule
pnpm vite-doctor . --framework vite --extends auto,vite/strict --rules vite/env/no-untyped-env
Why it matters
Runtime configuration has different server and client visibility. Using the framework API keeps environment data typed and scoped.
Recommended fix
Remove untyped env, or move it to the Vite runtime/API that owns that behavior.
Useful links
Example
Type import.meta.env access
Before
const apiBase = import.meta.env.VITE_API_BASE
After
interface ImportMetaEnv {
readonly VITE_API_BASE: string
}
const apiBase = import.meta.env.VITE_API_BASE