unplugin-auto-import icon indicating copy to clipboard operation
unplugin-auto-import copied to clipboard

rename or delete functions, will also exist in DTS

Open eed-cn opened this issue 1 year ago • 3 comments

The intent of the generateDTS function to read history and merge is ambiguous, and the code is very old.

version: unplugin-auto-import:^0.19.0 vite: ^6.0.4 config:

 AutoImport({
      dirs: [
         resolve(__dirname, './src/utils/**')
      ],
      dts: './src/auto-imports.d.ts',
})

error:

  const uid66: typeof import('./utils/html')['uid66']
  const uid6611: typeof import('./utils/html')['uid6611']
  const uid661122: typeof import('./utils/html')['uid661122']

generateDTS: https://github.com/unplugin/unplugin-auto-import/blob/e5cc63f921776153e921e62afedd3906d6debd8e/src/core/ctx.ts#L130-L161

eed-cn avatar Dec 20 '24 07:12 eed-cn

Same as #433 , and the historical reasons in #341 .

@antfu If there is a need for an option to control the DTS generation mode between 'overwrite' and 'additional'.

noootwo avatar Dec 24 '24 06:12 noootwo

If there is a need for an option to control the DTS generation mode between 'overwrite' and 'additional'.

I am up to it! PR welcome :)

antfu avatar Dec 24 '24 06:12 antfu

Ok, I'll make a PR later.

noootwo avatar Dec 24 '24 06:12 noootwo