From 8514d5ef589a8aa34e4d2260c618781d81368c22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <git@minelli.me>
Date: Wed, 27 Mar 2024 22:11:22 +0100
Subject: [PATCH] Lint => Update eslint

---
 helpers/Dojo/AssignmentValidator.ts               |  2 +-
 helpers/Dojo/ExerciseDockerCompose.ts             |  4 +++-
 .../Dojo/ExerciseResultsSanitizerAndValidator.ts  | 15 +++++----------
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/helpers/Dojo/AssignmentValidator.ts b/helpers/Dojo/AssignmentValidator.ts
index 0ac4f46..818a748 100644
--- a/helpers/Dojo/AssignmentValidator.ts
+++ b/helpers/Dojo/AssignmentValidator.ts
@@ -288,7 +288,7 @@ class AssignmentValidator {
     }
 
     run() {
-        (async () => {
+        void (async () => {
             try {
                 await this.checkRequirements();
 
diff --git a/helpers/Dojo/ExerciseDockerCompose.ts b/helpers/Dojo/ExerciseDockerCompose.ts
index 7b088c6..c76a95e 100644
--- a/helpers/Dojo/ExerciseDockerCompose.ts
+++ b/helpers/Dojo/ExerciseDockerCompose.ts
@@ -60,10 +60,12 @@ class ExerciseDockerCompose {
 
     private registerChildProcess(childProcess: ChildProcessWithoutNullStreams, resolve: (value: (number | PromiseLike<number>)) => void, reject: (reason?: unknown) => void, displayable: boolean, rejectIfCodeIsNotZero: boolean) {
         childProcess.stdout.on('data', data => {
+            // eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-call
             this.log(data.toString(), false, displayable);
         });
 
         childProcess.stderr.on('data', data => {
+            // eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-call
             this.log(data.toString(), true, displayable);
         });
 
@@ -73,7 +75,7 @@ class ExerciseDockerCompose {
     }
 
     run(doDown: boolean = false) {
-        (async () => {
+        void (async () => {
             let containerExitCode: number = -1;
 
             const filesOverrideArguments = this.composeFileOverride.map(file => `--file "${ file }"`).join(' ');
diff --git a/helpers/Dojo/ExerciseResultsSanitizerAndValidator.ts b/helpers/Dojo/ExerciseResultsSanitizerAndValidator.ts
index 0807668..c27722f 100644
--- a/helpers/Dojo/ExerciseResultsSanitizerAndValidator.ts
+++ b/helpers/Dojo/ExerciseResultsSanitizerAndValidator.ts
@@ -27,7 +27,7 @@ class ExerciseResultsSanitizerAndValidator {
         this.containerExitCode = containerExitCode;
     }
 
-    private async resultsFileSanitization() {
+    private resultsFileSanitization() {
         this.events.emit('step', 'RESULTS_FILE_SANITIZATION', 'Sanitizing results file');
 
         if ( this.exerciseResults.success === undefined ) {
@@ -57,7 +57,7 @@ class ExerciseResultsSanitizerAndValidator {
 
 
         // Results file content sanitization
-        await this.resultsFileSanitization();
+        this.resultsFileSanitization();
 
 
         // Results folder size
@@ -76,19 +76,14 @@ class ExerciseResultsSanitizerAndValidator {
         return true;
     }
 
-    private async resultsFileNotProvided(): Promise<boolean> {
-        await this.resultsFileSanitization();
-        return true;
-    }
-
     run() {
-        (async () => {
+        void (async () => {
             // Results file existence
             this.events.emit('step', 'CHECK_RESULTS_FILE_EXIST', 'Checking if results file exists');
             const resultsFileOriginPath = path.join(this.folderResultsExercise, ClientsSharedConfig.filenames.results);
             this.resultsFilePath = path.join(this.folderResultsDojo, ClientsSharedConfig.filenames.results);
 
-            let result: boolean;
+            let result: boolean = true;
             if ( fs.existsSync(resultsFileOriginPath) ) {
                 this.events.emit('endStep', 'CHECK_RESULTS_FILE_EXIST', 'Results file found', false);
 
@@ -102,7 +97,7 @@ class ExerciseResultsSanitizerAndValidator {
             } else {
                 this.events.emit('endStep', 'CHECK_RESULTS_FILE_EXIST', 'Results file not found', false);
 
-                result = await this.resultsFileNotProvided();
+                this.resultsFileSanitization();
             }
 
             if ( result ) {
-- 
GitLab