Stefanos Kargas
Stefanos Kargas

Reputation: 11103

How to deal with node_modules in PhpStorm

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:

  1. It is not included in the code inspection as far as the modules' internal code is concerned.
  2. It is included in the code inspection as far as references in my own code to the modules is concerned.
  3. It is included in 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:

Regardless my tries, what is the best way to deal with it?

Upvotes: 0

Views: 1264

Answers (1)

lena
lena

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

Related Questions