Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Next
-
None
-
None
Description
I have this piece of code:
/** * @param {Number} name description */ var test = function (name) { console.log(name); }; test("test");
You can see, that I declared the name parameter, inside my JSDoc param as typ Number. When I call my function, I give an argument as a string. In IntelliJ, there is a feature, where the IDE check the type of the param and the returning value and so on, via the JSDoc annotations.
You can find the information here: http://blog.jetbrains.com/webide/2012/10/validating-javascript-code-with-jsdoc-types-annotations/
This feature would be very nice, so we can have a semi type checker for JavaScript, without learning TypeScript or Flow or AtScript or whatever.
Regards
Chris