Ignore all node_modules in searches
Sometimes I'm looking for a keyword which is very common in node_modules packages e.g. EventHandler.
How can I exclude it from all node_modules? I'm running a lerna setup with subfolders in subfolders etc. and a couple levels deep, there might be additional node_modules, so just looking in a directory doesn't work for me.
Thanks!
请先登录再写评论。
You can use In Project scope when searching - it doesn't include libraries, so you won't see files from
node_modulesin search result when using it. JavaScript libraries are only included when using Directory scope with corresponding folder selected, or when using custom scope with explicit filters. Excluding libraries from custom scope is a bit tricky... To make it work, you need to prefix your scope pattern withfile[your_project_name]:*/&&to overwrite the default scope - see https://youtrack.jetbrains.com/issue/IDEA-145142#comment=27-1156171 for explanationNote also that starting from 2021.1 there is External Dependencies node in scopes which could be included/excluded directly, see https://youtrack.jetbrains.com/issue/IDEA-103560#focus=Comments-27-4703529.0-0