Reputation: 71
so I created a consoledata.ts
file to log whatever I pass in it as an argument like so:
/* eslint-disable no-console */
export default function ConsoleData(props: any) {
console.log(props);
}
now using the VSCode search icon, I changed every console.log
in my code to consoleData
since it'll probably take me all day to change them one by one.
now my issue is, the consoleData
module is not imported. is there a way I can do this?
Upvotes: 2
Views: 4081
Reputation: 11
You can use this plugin to identify unresolved imports, which can be fixed by IDE's fix options or --fix
flag for eslint. If you use aliases, check this one as well.
Upvotes: 0
Reputation: 1263
There are two ways to auto import in VSCode. The first way is using quick fix. If you are on MacOS, you can do Cmd + .
to open the quick fix dialog and then you import the module.
The second option is to use auto import suggestions. They show suggestions as you type. If you are on MacOS, select the function/class you want to import and then you can do Ctrl + Space
to open the auto import suggestions dialog.
Upvotes: 1