Today we had a discussion in NodeJS UA community chat. The discussion was around the topic "Why don't we have the hinting in those IDEs for NodeJS?".
It would be really great to have a code completion like this:
We have poked around the idea to add JSDoc types annotations but it turns out not working as we wish.
I remember the special JSDoc annotation files for jQuery I used a couple years ago, but they are not very usable.
After spending some time wondering, I have found the workaround for IntelliJ IDEA and other JetBrains tools (Webstorm, PHPStorm)!
We will use typescript community stubs to make the magic!
The steps you need to accomplish:
- Click the Download button and select TypeScript community stubs
- Locate the node entry and hit Download and Install button!
- Verify that library is installed and enabled and has the Global scope.
- And now, at last, you can enjoy hacking NodeJS with type hints and autocompletion!