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

@ -28,7 +28,7 @@ const hstsSchema = Joi.object({
preload: Joi.boolean().default(true).optional().label('HD_HSTS_PRELOAD'),
});
export default registerAs('hstsConfig', async () => {
export default registerAs('hstsConfig', () => {
const hstsConfig = hstsSchema.validate(
{
enable: process.env.HD_HSTS_ENABLE,
@ -42,10 +42,10 @@ export default registerAs('hstsConfig', async () => {
},
);
if (hstsConfig.error) {
const errorMessages = await hstsConfig.error.details.map(
const errorMessages = hstsConfig.error.details.map(
(detail) => detail.message,
);
throw new Error(buildErrorMessage(errorMessages));
}
return hstsConfig.value;
return hstsConfig.value as HstsConfig;
});