Commit 77361825 authored by ZeHiro's avatar ZeHiro Committed by ZeHiro
Browse files

Fix callback-return lint rule

parent 5b677aec
......@@ -250,7 +250,7 @@
# Node.js and CommonJS
#######################################################################
callback-return:
- 0 # TODO?
- 2
global-require:
- 0
handle-callback-err:
......
......@@ -16,7 +16,7 @@ export async function preloadAccess(req, res, next, accessId) {
throw new KError('bank access not found', 404);
}
req.preloaded = { access };
next();
return next();
} catch (err) {
return asyncErr(res, err, 'when finding bank access');
}
......
......@@ -17,7 +17,7 @@ export async function preloadAccount(req, res, next, accountID) {
throw new KError('Bank account not found', 404);
}
req.preloaded = { account };
next();
return next();
} catch (err) {
return asyncErr(res, err, 'when preloading a bank account');
}
......
......@@ -11,7 +11,7 @@ export async function loadAlert(req, res, next, alertId) {
}
req.preloaded = req.preloaded || {};
req.preloaded.alert = alert;
next();
return next();
} catch (err) {
return asyncErr(res, err, 'when preloading alert');
}
......
......@@ -37,7 +37,7 @@ export async function preloadCategory(req, res, next, id) {
throw new KError('Category not found', 404);
req.preloaded = { category };
next();
return next();
} catch (err) {
return asyncErr(res, err, 'when preloading a category');
}
......
......@@ -15,7 +15,7 @@ async function preload(varName, req, res, next, operationID) {
}
req.preloaded = req.preloaded || {};
req.preloaded[varName] = operation;
next();
return next();
} catch (err) {
return asyncErr(res, err, 'when preloading an operation');
}
......
......@@ -32,5 +32,5 @@ ${err.stack}`);
}
if (callback)
callback(app, server);
return callback(app, server);
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment