eslint: disable warning - `defined but never used` for specific function?
Provide a config comment telling it to ignore that rule (defined but never used is the no-unused-vars
rule)
function render() { // eslint-disable-line no-unused-vars
// do stuff
var x; // still raises defined but never used
}
If you dont want to change the code.
ESLint provides both a way to disable, both to enable the linting via comments. You only added before functions /* eslint-disable */
and after functions /* eslint-enable */
Example
/* eslint-disable */ <-- Before function
function render(){
// do stuff
}
/* eslint-enable */ <-- After function
More info