Invalid # of Parameters Syntax Validation Wrong With Optional Parameters in JavaScript

In JavaScript (also happens in PHP) it's ok to call functions without all their parameters, and in fact it is often by design that some parameters need not be specified. However, the syntax validation marks it as a minor warning. I'm trying to configure IDEA so that my team has to check in code that does not have any errors or warnings, but this validation is preventing that.

I have attached an image of an example. The Form.getElements function requires only 1 parameter, but has 2 optional parameters.

In the JavaDoc statement for the function I state which arguments are optional and would like to a) know if there is a way to inform the syntax validation about optional paramters, or b) turn off this inspection for JavaScript.

thanks,
-matt



Attachment(s):
Picture 2.png

Please sign in to leave a comment.