VS Code tips — Add missing imports on save for JavaScript and TypeScript

preview_player
Показать описание
Today's VS code tip: add missing imports on save

To enable, just set:

Рекомендации по теме
Комментарии
Автор

Great video, and thanks.
For some reasons I'm not getting the quick-fix: add (all) imports. It seems that vscode doesn't recognise my variables after I type them out. They will show up in suggestion as I type and will auto-import if I click space but after typing them out, it seems they are no longer recognized. Any ideas?
PS: I have
{
"checkJs": true,
"jsx": "react",
"compilerOptions": {
"baseUrl": "src"
}
}
In my jsconfig.json file at the root of my project.

andyoee
Автор

This option is now an object. You should try
"editor.codeActionsOnSave": {
"source.addMissingImports": true,

},
Great video btw!

broceedwin
Автор

Ho cool this is the answer to my Issue on GitHub (I can't find the documentation about the codeActionsOnSave feature #104219) How can I have the reference to that from say VS Code documentation?

Luxcium
join shbcf.ru