Reputation: 11103
I have been setting up my development environment for my Laravel/AngularJS
project. My IDE is JetBrains PhpStorm. I am wondering what are the best practices for configuring the IDE to deal with the node_modules
(or bower_components
or vendor
for my PHP) folder, so that:
code inspection
as far as the modules' internal code is concerned.code inspection
as far as references in my own code to the modules is concerned.Autocomplete
or Code Navigation
(Ctrl+click on methods)To make it more clear: I want to be able to Ctrl+click on methods of my node modules and be redirected to the source code of these modules. I also want to be warned if I write a node module method wrong, or if it does not exist. Also autocomplete a method, when I press Ctrl+Space. But I don't want the internal code of my node modules to be included in code inspection, because it takes a lot of time to inspect all the modules, and they are supposed to be ok, so I don't need to inspect them.
I already tried two solutions:
Scope
(in PhpStorm Settings), that includes all files except the node_modules
folder, to use when I manually run Code Inspection
: It is impossible to exclude the node_modules
folder, because my IDE recognizes it as a module "I think" (it has [webapp] next to it in the Project explorer). I could however exclude bower_components
and vendor
.Regardless my tries, what is the best way to deal with it?
Upvotes: 0
Views: 1264
Reputation: 93908
As it's mentioned in help, PhpStorm auto-excludes node_modules
folder from indexing for better performance, adding the direct dependencies listed in package.json
to javascript libraries for completion, etc. So the best way to handle node_modules
is relying on the IDE default procedures
Upvotes: 1