Fix all 93 ESLint issues (3 errors, 90 warnings) (#666)

This commit is contained in:
Thomas Durieux
2026-04-15 09:04:22 +02:00
committed by GitHub
parent 1d97c76e7e
commit f4209110c7
28 changed files with 77 additions and 69 deletions
+7 -7
View File
@@ -25,7 +25,7 @@ export default class FileSystem extends StorageBase {
const stat = await fs.promises.stat(fullPath);
if (stat.isDirectory()) return FILE_TYPE.FOLDER;
if (stat.isFile()) return FILE_TYPE.FILE;
} catch (_) {
} catch {
// ignore file not found or not downloaded
}
return FILE_TYPE.NOT_FOUND;
@@ -65,13 +65,13 @@ export default class FileSystem extends StorageBase {
try {
await this.mk(repoId, dirname(p));
if (data instanceof Readable) {
data.on("error", (err) => {
data.on("error", (_err) => {
this.rm(repoId, p);
});
}
return await fs.promises.writeFile(fullPath, data, "utf-8");
} catch (err: any) {
// throw err;
} catch {
// write error ignored
}
}
@@ -91,8 +91,8 @@ export default class FileSystem extends StorageBase {
await fs.promises.mkdir(fullPath, {
recursive: true,
});
} catch (err: any) {
if (err.code !== "EEXIST") {
} catch (err: unknown) {
if (err instanceof Error && (err as NodeJS.ErrnoException).code !== "EEXIST") {
throw err;
}
}
@@ -135,7 +135,7 @@ export default class FileSystem extends StorageBase {
})
);
}
} catch (error) {
} catch {
// ignore stat errors for individual files
}
}
+3 -3
View File
@@ -55,7 +55,7 @@ export default class S3Storage extends StorageBase {
// if we can get the file info, it is a file
await this.fileInfo(repoId, path);
return FILE_TYPE.FILE;
} catch (err) {
} catch {
// check if it is a directory
const data = await this.client().listObjectsV2({
Bucket: config.S3_BUCKET,
@@ -69,7 +69,7 @@ export default class S3Storage extends StorageBase {
}
/** @override */
async mk(repoId: string, dir: string = ""): Promise<void> {
async mk(repoId: string, _dir: string = ""): Promise<void> {
// no need to create folder on S3
}
@@ -125,7 +125,7 @@ export default class S3Storage extends StorageBase {
} else {
res.end();
}
} catch (error) {
} catch {
try {
res.status(500);
} catch (err) {