How to disable auto import from specific files in VSCode?

6.8k Views Asked by At

Is there any way to tell vscode to not autoimport from specific files?

2

There are 2 best solutions below

5
On BEST ANSWER

No. VS Code will pick up auto imports from all files in your jsconfig or tsconfig project.

If the file should not be part of your project, you can exclude it using the excludes or includes / files configuration option in the jsconfig or tsconfig

0
On

VSCode now supports this natively, if your project uses TypeScript 4.8+.

Just search for "auto import" in your settings menu, or use the typescript.preferences.autoImportFileExcludePatterns key in your json.

enter image description here