Update: Since Version 2.0 EAP 98.458 you get JavaScript library support, thus the following is obsolet.
In case you were wondering how you get dojo code support in PHPStorm even if dojo is not in your project folder, here’s the solution:
1. Open Project Settings
2. Select Directories
3. Add the path to your dojo folder as a new Content Root.
4. Mark the directories dijit, dojo, dojox as a Resource Root
That’s it.