Address all eslint warnings

Address all eslint warnings that were still present by:

* Extracting code to a new function in order to reduce complexity
* Renamed error variables and use shorthand notation for objects
* Disabling eslint warnings where addressing the issue would require too much refactoring
This commit is contained in:
Jose Bolos
2022-04-11 16:16:54 +01:00
parent 0e7849dd07
commit b9b049ec2b
7 changed files with 61 additions and 46 deletions

View File

@@ -33,8 +33,8 @@ require('./app')(config, (error, app) => {
console.log(kleur.grey('mode: %s'), process.env.NODE_ENV);
console.log(kleur.grey('uri: %s'), app.address);
app.on('route-error', error => {
const stack = (error.stack ? error.stack.split('\n') : [error.message]);
app.on('route-error', routeError => {
const stack = (routeError.stack ? routeError.stack.split('\n') : [routeError.message]);
const msg = kleur.red(stack.shift());
console.error('');
console.error(msg);
@@ -43,9 +43,9 @@ require('./app')(config, (error, app) => {
// Start the webservice if required
if (typeof config.webservice === 'object') {
require('pa11y-webservice')(config.webservice, (error, webservice) => {
if (error) {
console.error(error.stack);
require('pa11y-webservice')(config.webservice, (webserviceError, webservice) => {
if (webserviceError) {
console.error(webserviceError.stack);
process.exit(1);
}