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
}
};
You can modify WebStorm's builtin code inspections under File->Settings->Editor->Inspections. Then in Javascript->General area look for "Unused JavaScript / ActionScript global symbol".
That is likely the setting which is causing the "unused property" warning, though it might be one of the others. I am using 2016.1.3 and noticed a lot of my anonymous functions defined like this had the same buggy warning. Like most others I'd still recommend using jsHint itself above and beyond even just WebStorm's inspection.
For WebStorm with JSLint/JSHint disabled, you need to add this line before the line triggering the error:
//noinspection JSUnusedLocalSymbols
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With