-
Notifications
You must be signed in to change notification settings - Fork 763
Description
When evaluating tsgo (7.0.0-dev.20250528.1), I've noticed an error not visible in TypeScript (5.8.3):
vitest.config.ts:9:18 - error TS7006: Parameter 'id' implicitly has an 'any' type.
9 async load(id) {
I dug deeper and found that the defineConfig function from vitest/config has any instead of the expected types.
In vitest/dist/config.d.ts, we find:
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';The first line returns errors for both imports:
Module '"node_modules/vite/index"' has no exported member '<IMPORT NAME HERE>'.
ctrl-clicking vite import path, I ended up in node_modules/vite/index.d.cts - something that I didn't expect, and what seems to be the clue of the original error.
ctrl-clicking vite import path in TypeScript 5.8.3, I end up with a different resolved path: node_modules/vite/dist/node/index, while the types appear to be resolved to node_modules/vitest/dist/chunks/vite.Cu7NWuBa.d.ts (which includes declare module 'vite' { … bit).
Vite's imports are configured like so: