In this case, you can do something like below
if (app.get('env') === 'development') { app.use(function (err, req, res, next) { var foo; res.status(err.status || 500); res.render('error', { message: err.message, error: err }); }); }
Now jshint will not cry about next , although it will still warn about foo , which will be determined, but will not be used.
It is important that this suppression will be related to the scope of the function.
source share