From 14b07d7d762bf7ff76c12393928cbf341ff5b98b Mon Sep 17 00:00:00 2001 From: Tuomas Siipola Date: Tue, 26 Nov 2024 14:01:20 +0200 Subject: [PATCH] lint --- backend/src/lib/auth.ts | 1 - backend/src/routes/upload.ts | 4 ++-- backend/tests/integration/sequential/file.test.ts | 6 +++--- backend/tests/integration/sequential/sites.test.ts | 2 +- backend/tests/integration/sequential/upload.test.ts | 3 +-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backend/src/lib/auth.ts b/backend/src/lib/auth.ts index 9c91dac5f..6b8f3f7a2 100644 --- a/backend/src/lib/auth.ts +++ b/backend/src/lib/auth.ts @@ -1,7 +1,6 @@ import { DataSource, Repository } from "typeorm"; import { RequestHandler, Response } from "express"; import { UserAccount } from "../entity/UserAccount"; -import { InstrumentUpload, ModelUpload } from "../entity/Upload"; import { PermissionType } from "../entity/Permission"; import { Site } from "../entity/Site"; import basicAuth = require("basic-auth"); diff --git a/backend/src/routes/upload.ts b/backend/src/routes/upload.ts index 429551f13..147614003 100644 --- a/backend/src/routes/upload.ts +++ b/backend/src/routes/upload.ts @@ -1,7 +1,7 @@ import { Site } from "../entity/Site"; import { InstrumentUpload, ModelUpload, Status, Upload } from "../entity/Upload"; import { DataSource, EntityTarget, FindOptionsWhere, Repository, Brackets, SelectQueryBuilder } from "typeorm"; -import { NextFunction, RequestHandler } from "express"; +import { RequestHandler } from "express"; import { ArrayEqual, dateforsize, @@ -19,7 +19,7 @@ import { } from "../lib"; import { basename } from "path"; import { ReducedMetadataResponse } from "../entity/ReducedMetadataResponse"; -import validator, { isIn } from "validator"; +import validator from "validator"; import { Instrument, InstrumentInfo } from "../entity/Instrument"; import { Model } from "../entity/Model"; import { ModelFile, RegularFile } from "../entity/File"; diff --git a/backend/tests/integration/sequential/file.test.ts b/backend/tests/integration/sequential/file.test.ts index 8b7121b24..66302e27a 100644 --- a/backend/tests/integration/sequential/file.test.ts +++ b/backend/tests/integration/sequential/file.test.ts @@ -2,18 +2,18 @@ import { DataSource, Repository } from "typeorm"; import { ModelFile, RegularFile } from "../../../src/entity/File"; import { readFileSync } from "fs"; import { backendPrivateUrl, storageServiceUrl, str2base64 } from "../../lib"; -import axios from "axios"; import { Visualization } from "../../../src/entity/Visualization"; import { SearchFile } from "../../../src/entity/SearchFile"; import { ModelVisualization } from "../../../src/entity/ModelVisualization"; import { FileQuality } from "../../../src/entity/FileQuality"; import { QualityReport } from "../../../src/entity/QualityReport"; import { initUsersAndPermissions } from "../../lib/userAccountAndPermissions"; -const uuidGen = require("uuid"); -const crypto = require("crypto"); import { readResources } from "../../../../shared/lib"; import { AppDataSource } from "../../../src/data-source"; import { describe, expect, it, beforeAll, afterAll, beforeEach } from "@jest/globals"; +import axios from "axios"; +const uuidGen = require("uuid"); +const crypto = require("node:crypto"); let dataSource: DataSource; let fileRepo: Repository; diff --git a/backend/tests/integration/sequential/sites.test.ts b/backend/tests/integration/sequential/sites.test.ts index 978f0fcd2..2ac38f2de 100644 --- a/backend/tests/integration/sequential/sites.test.ts +++ b/backend/tests/integration/sequential/sites.test.ts @@ -7,7 +7,7 @@ import { Visualization } from "../../../src/entity/Visualization"; import { SearchFile } from "../../../src/entity/SearchFile"; import { AppDataSource } from "../../../src/data-source"; import { beforeAll, beforeEach, afterAll, describe, it, expect } from "@jest/globals"; -const crypto = require("crypto"); +const crypto = require("node:crypto"); const url = `${backendPublicUrl}sites/`; let resources: any; diff --git a/backend/tests/integration/sequential/upload.test.ts b/backend/tests/integration/sequential/upload.test.ts index 15639082c..5c5d094ec 100644 --- a/backend/tests/integration/sequential/upload.test.ts +++ b/backend/tests/integration/sequential/upload.test.ts @@ -8,9 +8,8 @@ import { AppDataSource } from "../../../src/data-source"; import { ModelFile, RegularFile } from "../../../src/entity/File"; import { ArrayEqual } from "../../../src/lib"; import { beforeAll, beforeEach, afterAll, describe, it, expect, jest } from "@jest/globals"; -import { response } from "express"; -const crypto = require("crypto"); +const crypto = require("node:crypto"); jest.setTimeout(20000);