Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable auto import from specific files in VSCode?

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

like image 517
Nekor Avatar asked Dec 13 '17 15:12

Nekor


People also ask

How do I stop auto import in VS Code?

You can disable auto-import on completion and use quick-fixes instead: In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | General | Auto Import. On the Auto Import page that opens, use the checkboxes in the TypeScript/JavaScript area to enable or disable import generation on code completion.

How do I optimize imports in VS Code?

In VSCode, go to File -> Preferences -> Settings and click on the icon in the top right hand corner to open up the settings in JSON. Et voilà! Your imports will now be organized every time you save a file.


1 Answers

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

like image 159
Matt Bierner Avatar answered Oct 25 '22 23:10

Matt Bierner