`imports` option type is resolved as any
### Describe the bug
Hi, I just created a new Vite project and noticed that the imports option in unplugin-auto-import is typed as `any`.
This makes it hard to know what presets are actually supported 😅
```ts
import { defineConfig } from 'vite'
import autoImport from 'unplugin-auto-import/vite' // same behavior with /webpack
export default defineConfig({
plugins: [
autoImport({
imports: [],
// ^? = any
}),
],
})
```
Would be nice if this had proper typings or showed the preset suggestions (like `vue`, `@vueuse/core`, etc).
### Reproduction
https://stackblitz.com/edit/vitejs-vite-9wzbyhyl?file=vite.config.ts&view=editor
### System Info
```Shell
any
```
### Used Package Manager
pnpm
### Validations
- [x] Follow our [Code of Conduct](https://github.com/antfu/.github/blob/main/CODE_OF_CONDUCT.md)
- [x] Read the [Contributing Guide](https://github.com/antfu/contribute).
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [x] The provided reproduction is a [minimal reproducible](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
关闭于 2025-11-27 1 条评论