Fix various ESLint errors in configs

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-24 20:29:39 +01:00
parent 616f963b8e
commit 208ff1d039
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
8 changed files with 25 additions and 19 deletions

View file

@ -18,7 +18,7 @@ const cspSchema = Joi.object({
reportURI: Joi.string().optional().label('HD_CSP_REPORT_URI'),
});
export default registerAs('cspConfig', async () => {
export default registerAs('cspConfig', () => {
const cspConfig = cspSchema.validate(
{
enable: process.env.HD_CSP_ENABLE || true,
@ -30,10 +30,10 @@ export default registerAs('cspConfig', async () => {
},
);
if (cspConfig.error) {
const errorMessages = await cspConfig.error.details.map(
const errorMessages = cspConfig.error.details.map(
(detail) => detail.message,
);
throw new Error(buildErrorMessage(errorMessages));
}
return cspConfig.value;
return cspConfig.value as CspConfig;
});