Skip to content

imports option type is resolved as any #606

@daopk

Description

@daopk

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 😅

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

any

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions