N
Nuxt6mo ago
Martial

How can I prevent VSCode from adding the import statement for auto-imported components?

I can choose not to auto-complete and then that's fine, but it's prone to error and end up in an error (image), how do you deal with it ?
No description
No description
No description
5 Replies
LazyDali
LazyDali6mo ago
Good question, I am also interested into the answer. I find this annoying. I’ll search and get back to you.
LazyDali
LazyDali6mo ago
We definitely want to keep the auto-import in the nuxt config file (https://nuxt.com/docs/guide/concepts/auto-imports) but there should be a way to disable auto explicit imports.
Nuxt
Auto-imports · Nuxt Concepts
Nuxt auto-imports components, composables, helper functions and Vue APIs.
Martial
MartialOP6mo ago
Maybe we can look into how to tweak vscode config so that it doesnt suggest to import from the component directory
Cue
Cue6mo ago
You could add the following to your vscode workspace settings?
"typescript.preferences.autoImportFileExcludePatterns": [
"#build/components"
]
"typescript.preferences.autoImportFileExcludePatterns": [
"#build/components"
]
Martial
MartialOP6mo ago
I need to try that! This seems to work, thanks mate !
Want results from more Discord servers?
Add your server