I created a scope that has !file[myproj]:/node_modules// and also tried !file[myproj]://node_modules// to not include any subdirectories that is under node_modules i.e. not include any files in any of these :
/node_modules/*
a/node_modules/*
b/c/node_modules/*
e/f/g/node_modules/*
anything/preceding/the/folder/node_modules/*
but the search still shows matches in the node_module files. What is the correct pattern to use?
You must have faced the issue because node_modules
are only partially excluded - direct dependencies listed in package.json
are added to JavaScript libraries and thus included.
To exclude node_modules
completely, use In Project scope for searching. JavaScript libraries are only included when using Directory scope with corresponding folder selected, or when using custom scope with explicit filters.
Note that excluding libraries from custom scope is a bit tricky... To make it work, you need to prefix your scope pattern with file[your_project_name]:*/&&
to overwrite the default scope - see https://youtrack.jetbrains.com/issue/IDEA-145142#comment=27-1156171 for explanation
Related feature request: IDEA-103560
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With