VSCode Intellisense: "Add import from" only suggests relative path for `cn`
When using the Quick Fix menu in VSCode ("Cmd + ."), it only suggests the relative path to import my cn function. It DOES work correctly when I'm trying to add an import for something in my components directory (see screenshots). They appear to be set up the same so I'm not sure what gives.
In my tsconfig.json file, I have
I don't think this is relevant, but my shadcn components.json file includes:
2 Replies
Note: The import alias "@/lib/utils" does work fine, the issue is that I have to manually type it and Intellisense does not suggest it using the Quick Fix menu in VSCode.
Oof. OK actually I see now that it only worked for the components import because I was already importing things from that alias. If I remove all of the imports from "@/components/ui/dropdown-menu", the Quick Fix menu also only suggests the relative path.
So how do I get Intellisense to suggest my import aliases instead of the relative path?
Solution
I figured it out. I needed to set
in my VScode settings.json file