coderman coderman - 3 months ago 55
Javascript Question

WebStorm - Suppress unused param warning JavaScript

Does anyone know how to suppress unused parameter warning in WebStorm? I tried jslint, but that does not work

/*jslint node: true, unparam: true*/
/*global __dirname: false */
"use strict";
var
util = require('../util'),
logger = util.getLogger(module.filename),
;

var UserHelper = module.exports = function () {
};

/**
* Helper object for user facade
*/
UserHelper.prototype = {
doSomething : function(unusedParam) {
//do something implementation
}
};

Answer

jshint instead of jslint works for me on WebStorm 8 and WebStorm 9 beta:

/*jshint node:true, unused:false */

Also, make sure you have JSHint (or JSLint) enabled in your preferences. JSHint has "Warn about unused variables". NOTE: This JSHint check does not distinguish between variables and function parameters unless JSHint is configured with unused:vars.

You can also uncheck the "Unused parameters" option under the JSLint configuration screen.

Relevant JSHint doc