How to stop auto import for specific package
whenever I type the symbol data
in my front end project the IDE will auto import import { data } from 'msw';
This is unintended and always causes my browser to complain. Whenever I remove it, it will just auto import again. The only workaround is I have to define data
before hand so it doesn't auto import.
I've tried searching up how to exclude this one symbol but all the documentation and tutorials are out of date.
What am I missing?
Please sign in to leave a comment.
What package version do you use? I failed to reproduce the issue with
msw@2.2.0
, it doesn't seem to exportdata
module. Anyway, I believe that marking thenode_modules/msw/lib/core/index.d.ts
and otherd.ts
files there as plain text should help. To do this, right-click a file, select Override File Type, and then choose Plain text from the available options. This will completely exclude the file from indexing.I'm currently using
"msw": “^1.2.3”
The above worked with marking as plaintext, but is this best practice? Does the above auto import setting functionality not work as intended?
This is expected behavior if the package exports a module with the specified name - when entering it, the IDE prompts to import a module.