20

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

Nekor
  • 237
  • 2
  • 7

2 Answers2

10

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

Matt Bierner
  • 58,117
  • 21
  • 175
  • 206
4

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

panepeter
  • 3,224
  • 1
  • 29
  • 41