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 databefore 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?

0
4 comments

What package version do you use? I failed to reproduce the issue with msw@2.2.0, it doesn't seem to export data module. Anyway, I believe that marking the node_modules/msw/lib/core/index.d.ts and other d.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.

0

I'm currently using "msw": “^1.2.3”

0

The above worked with marking as plaintext, but is this best practice? Does the above auto import setting functionality not work as intended?

0

This is expected behavior if the package exports a module with the specified name - when entering it, the IDE prompts to import a module.

0

Please sign in to leave a comment.