Skip to content

Instantly share code, notes, and snippets.

@dillionverma
Last active June 9, 2025 23:09
Show Gist options
  • Save dillionverma/4450c1fc106002117c3aa35bddab9e94 to your computer and use it in GitHub Desktop.
Save dillionverma/4450c1fc106002117c3aa35bddab9e94 to your computer and use it in GitHub Desktop.
How to stop @radix-ui, next/router and lucide-react auto-imports
declare module 'lucide-react' {
export * from 'lucide-react/dist/lucide-react.suffixed'
}
{
"typescript.preferences.autoImportSpecifierExcludeRegexes": [
"@radix-ui",
"next/router",
"next/dist",
"^lucide-react/dist/lucide-react.suffixed$",
]
}
{
"compilerOptions": {
"baseUrl": ".",
}
}
@Ardian-Hoti
Copy link

how do i import icons from lucide-react with this?, its not working

Module '"lucide-react"' has no exported member 'ExternalLink'.
and for other icons

@dillionverma
Copy link
Author

Using this approach implies that Icon imports will always be suffixed with Icon. For example ExternalLink will no longer work but ExternalLinkIcon will. @Ardian-Hoti

@Ardian-Hoti
Copy link

Using this approach implies that Icon imports will always be suffixed with Icon. For example ExternalLink will no longer work but ExternalLinkIcon will. @Ardian-Hoti

Oh okay, so i have to change all my icons in my entire app to have icon in the end, okay a bit of work for now but for future time saver. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment