Implement no floating promises on eslint rules

This commit is contained in:
Alexis Faizeau 2021-11-08 14:45:25 +01:00
parent 6c6a7e6fe4
commit c573e9fbaf
2 changed files with 5 additions and 1 deletions

View File

@ -25,6 +25,7 @@
], ],
"rules": { "rules": {
"no-unused-vars": "off", "no-unused-vars": "off",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-explicit-any": "error" "@typescript-eslint/no-explicit-any": "error"
} }
} }

View File

@ -47,7 +47,10 @@ function formData(
if (typeof options.tmpDir === "string") { if (typeof options.tmpDir === "string") {
if (typeof options.filename === "function") filename = options.filename(filename); if (typeof options.filename === "function") filename = options.filename(filename);
const fileToSave = join(options.tmpDir, filename); const fileToSave = join(options.tmpDir, filename);
mkdirp(dirname(fileToSave)); mkdirp(dirname(fileToSave)).then(
() => {},
() => {}
);
file.pipe(createWriteStream(fileToSave)); file.pipe(createWriteStream(fileToSave));
value.filePath = fileToSave; value.filePath = fileToSave;