Suppress unused parameter for empty JavaScript method?

We have an abstract API JavaScript class and define the methods with parameters and empty body. We are getting 'Unused parameter apiOptions' but not an option to suppress it like other inspection errors. Generally this is a good inspection warning but in this case I want to ignore it. Any ideas?


    /**
     *
     * @param {apiOptions|Object} apiOptions
     */
    login: function(apiOptions) {},

3 comments
Comment actions Permalink

Hi Mike,

I couldn't think of a workaround here. We currently support only @interface tag, i.e. parameters of interface methods are not highlighted as unused. I've created two issues, please watch them to get notified about progress.
http://youtrack.jetbrains.com/issue/WEB-100336
http://youtrack.jetbrains.com/issue/WEB-100337

Regards,
Konstantin

0
Comment actions Permalink

Though this is an older thread I would like to add note on solving this issue in PhpStorm 8 (and probably in Webstorm 8 as well) for links listed by Konstantin don't work anymore.

The warning on unused parameters might be suppressed in a case like above ny annotating the function with @abstract. However, if your annotations describe some mandatory return value this must be given in abstract method for whatever reason.

0
Comment actions Permalink

Thanks for the response. @abstract also works on WebStorm 6.0

0

Please sign in to leave a comment.