From c573e9fbaf29c8aae6dc59b9a2e3078030723587 Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Mon, 8 Nov 2021 14:45:25 +0100 Subject: [PATCH] Implement no floating promises on eslint rules --- back/.eslintrc.json | 1 + back/src/Server/server/formdata.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/back/.eslintrc.json b/back/.eslintrc.json index 3aab37d9..0b5e39da 100644 --- a/back/.eslintrc.json +++ b/back/.eslintrc.json @@ -25,6 +25,7 @@ ], "rules": { "no-unused-vars": "off", + "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-explicit-any": "error" } } diff --git a/back/src/Server/server/formdata.ts b/back/src/Server/server/formdata.ts index 66e51db4..0e17de78 100644 --- a/back/src/Server/server/formdata.ts +++ b/back/src/Server/server/formdata.ts @@ -47,7 +47,10 @@ function formData( if (typeof options.tmpDir === "string") { if (typeof options.filename === "function") filename = options.filename(filename); const fileToSave = join(options.tmpDir, filename); - mkdirp(dirname(fileToSave)); + mkdirp(dirname(fileToSave)).then( + () => {}, + () => {} + ); file.pipe(createWriteStream(fileToSave)); value.filePath = fileToSave;