diff --git a/agent/src/pewpewtest.ts b/agent/src/pewpewtest.ts index aa481a08..4effc842 100644 --- a/agent/src/pewpewtest.ts +++ b/agent/src/pewpewtest.ts @@ -215,7 +215,6 @@ export class PewPewTest { } // Create a sanitized copy which doesn't have the environment variables which may have passwords - // eslint-disable-next-line @typescript-eslint/ban-types public sanitizedCopy (): { started: boolean, pewpewRunning: boolean, diff --git a/common/integration/s3.spec.ts b/common/integration/s3.spec.ts index 956d270d..520aa4f8 100644 --- a/common/integration/s3.spec.ts +++ b/common/integration/s3.spec.ts @@ -126,7 +126,7 @@ describe("S3Util Integration", () => { `${UNIT_TEST_KEY_PREFIX}/${UNIT_TEST_KEY_PREFIX}/${UNIT_TEST_FILENAME}` ].map((s3Path: string) => deleteObject(s3Path).catch((error) => log("S3Util Integration before delete failed: " + s3Path, LogLevel.DEBUG, error)))); - } catch (error) { + } catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars // Swallow } }); diff --git a/common/src/ppaastestmessage.ts b/common/src/ppaastestmessage.ts index a9baa9a0..5f6f5b20 100644 --- a/common/src/ppaastestmessage.ts +++ b/common/src/ppaastestmessage.ts @@ -140,7 +140,7 @@ export class PpaasTestMessage implements TestMessage { case "TestMessage": try { parsedTestMessage = temp as TestMessage; - } catch (error: unknown) { + } catch (error: unknown) { // eslint-disable-line @typescript-eslint/no-unused-vars throw new Error(`messageAttributes[${key}] was not an TestMessage = ${JSON.stringify(temp)}`); } break; diff --git a/common/src/s3file.ts b/common/src/s3file.ts index e55799e9..b04c4b2b 100644 --- a/common/src/s3file.ts +++ b/common/src/s3file.ts @@ -171,7 +171,7 @@ export class PpaasS3File implements S3File { try { await access(this.localFilePath); return true; - } catch (error: unknown) { + } catch (error: unknown) { // eslint-disable-line @typescript-eslint/no-unused-vars return false; } } diff --git a/common/test/yamlparser.spec.ts b/common/test/yamlparser.spec.ts index 0fd0627d..776466d7 100644 --- a/common/test/yamlparser.spec.ts +++ b/common/test/yamlparser.spec.ts @@ -3,9 +3,7 @@ import { expect } from "chai"; import path from "path"; const UNIT_TEST_FOLDER = process.env.UNIT_TEST_FOLDER || "test"; -// eslint-disable-next-line @typescript-eslint/no-unused-vars const BAD_FILEPATH = path.join(UNIT_TEST_FOLDER, "s3test.txt"); -// eslint-disable-next-line @typescript-eslint/no-unused-vars const EMPTY_FILEPATH = path.join(UNIT_TEST_FOLDER, "empty.yaml"); const BASIC_FILEPATH = path.join(UNIT_TEST_FOLDER, "basic.yaml"); const BASIC_FILEPATH_WITH_VARS = path.join(UNIT_TEST_FOLDER, "basicwithvars.yaml"); diff --git a/controller/components/StartTestForm/index.tsx b/controller/components/StartTestForm/index.tsx index 226dba4c..982aa300 100644 --- a/controller/components/StartTestForm/index.tsx +++ b/controller/components/StartTestForm/index.tsx @@ -62,7 +62,7 @@ const UploadTestButton = styled.button` const notAuthorizedMessageOpenId = (username?: string | null): JSX.Element =>

- {`'${username}'` || "User"} is not authorized to run tests.
+ {username ? `'${username}'` : "User"} is not authorized to run tests.
Please request 'Pewpew - User' permission if you need to be able to run tests.

DO NOT request 'Non Prod' Permissions. Those are for internal authentication testing only. diff --git a/controller/components/StartTestForm/story.tsx b/controller/components/StartTestForm/story.tsx index 18560c4e..8351a634 100644 --- a/controller/components/StartTestForm/story.tsx +++ b/controller/components/StartTestForm/story.tsx @@ -57,7 +57,7 @@ const versionInitalProps: VersionInitalProps = { let ppaasTestId: PpaasTestId; try { ppaasTestId = PpaasTestId.makeTestId("Story"); -} catch (error) { +} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars // For some reason newer versions of storybook do not have path.extname() ppaasTestId = PpaasTestId.getFromS3Folder("Story/" + PpaasTestId.getDateString()); } diff --git a/controller/components/TestInfo/story.tsx b/controller/components/TestInfo/story.tsx index 6096706e..34079ec8 100644 --- a/controller/components/TestInfo/story.tsx +++ b/controller/components/TestInfo/story.tsx @@ -15,7 +15,7 @@ import { latestPewPewVersion } from "../../pages/api/util/clientutil"; let ppaasTestId: PpaasTestId; try { ppaasTestId = PpaasTestId.makeTestId("Story"); -} catch (error) { +} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars // For some reason newer versions of storybook do not have path.extname() ppaasTestId = PpaasTestId.getFromS3Folder("Story/" + PpaasTestId.getDateString()); } diff --git a/controller/components/TestResults/index.tsx b/controller/components/TestResults/index.tsx index 7726fc21..8aa6254b 100644 --- a/controller/components/TestResults/index.tsx +++ b/controller/components/TestResults/index.tsx @@ -115,7 +115,7 @@ const minMaxTime = (testResults: any) => { let startTime2 = Infinity; let endTime2 = -Infinity; - // eslint-disable-next-line @typescript-eslint/no-unused-vars + for (const [_, dataPoints] of testResults) { for (const point of dataPoints) { if (point.startTime) { diff --git a/controller/components/TestResults/model.ts b/controller/components/TestResults/model.ts index 571f37d7..27f55ec4 100644 --- a/controller/components/TestResults/model.ts +++ b/controller/components/TestResults/model.ts @@ -2,7 +2,6 @@ import { HDRHistogram } from "@fs/hdr-histogram-wasm"; type CheckType = string | ((x: unknown) => boolean); type Check = [string, CheckType]; -// eslint-disable-next-line @typescript-eslint/ban-types function isObject (o: unknown): o is object { return typeof o === "object" && !!o; } @@ -53,7 +52,6 @@ function isObject (o: unknown): o is object { * @returns failed check or undefined */ function propertyChecker ( - // eslint-disable-next-line @typescript-eslint/ban-types o: object, requiredChecks: Check[], unknownCheck?: CheckType, diff --git a/controller/components/TestResults/story.tsx b/controller/components/TestResults/story.tsx index 8adf0513..e4e54800 100644 --- a/controller/components/TestResults/story.tsx +++ b/controller/components/TestResults/story.tsx @@ -10,7 +10,7 @@ configureURL.baseS3Url = "/"; let ppaasTestId: PpaasTestId; try { ppaasTestId = PpaasTestId.makeTestId("Story"); -} catch (error) { +} catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars // For some reason newer versions of storybook do not have path.extname() ppaasTestId = PpaasTestId.getFromS3Folder("Story/" + PpaasTestId.getDateString()); } diff --git a/controller/components/TestsList/story.tsx b/controller/components/TestsList/story.tsx index fe91f64e..923a8307 100644 --- a/controller/components/TestsList/story.tsx +++ b/controller/components/TestsList/story.tsx @@ -24,7 +24,7 @@ const makeTestData = (status: TestStatus): TestData => { ppaasTestId = PpaasTestId.makeTestId("Story" + counter, { dateString: PpaasTestId.getDateString(date) }); - } catch (error) { + } catch (error) { // eslint-disable-line @typescript-eslint/no-unused-vars // For some reason newer versions of storybook do not have path.extname() ppaasTestId = PpaasTestId.getFromS3Folder(`Story${counter}/` + PpaasTestId.getDateString(date)); } diff --git a/controller/integration/secrets.spec.ts b/controller/integration/secrets.spec.ts index 4b03d103..acbbbc50 100644 --- a/controller/integration/secrets.spec.ts +++ b/controller/integration/secrets.spec.ts @@ -21,7 +21,6 @@ import { expect } from "chai"; logger.config.LogFileName = "ppaas-controller"; describe("Secrets Integration", () => { - // eslint-disable-next-line require-await before(async () => { secretsConfig.secretsClient = undefined as any; getGlobalSecretsConfig().encryptionKey = undefined; diff --git a/controller/pages/api/util/healthcheck.ts b/controller/pages/api/util/healthcheck.ts index 29d59e71..5d7cb6a5 100644 --- a/controller/pages/api/util/healthcheck.ts +++ b/controller/pages/api/util/healthcheck.ts @@ -69,7 +69,7 @@ export function accessEncryptionKeyPass (): boolean { log("accessEncryptionKeyPass", LogLevel.DEBUG, { keyPass }); return keyPass; } catch (error) { - log("accessEncryptionKeyPass", LogLevel.WARN, { keyPass: false }); + log("accessEncryptionKeyPass", LogLevel.WARN, error, { keyPass: false }); return false; } } @@ -80,7 +80,7 @@ export function accessOpenIdSecretPass (): boolean { log("accessOpenIdSecretPass", LogLevel.DEBUG, { secretPass }); return secretPass; } catch (error) { - log("accessOpenIdSecretPass", LogLevel.WARN, { secretPass: false }); + log("accessOpenIdSecretPass", LogLevel.WARN, error, { secretPass: false }); return false; } } diff --git a/controller/pages/api/util/s3.ts b/controller/pages/api/util/s3.ts index 6c50604a..61158d35 100644 --- a/controller/pages/api/util/s3.ts +++ b/controller/pages/api/util/s3.ts @@ -73,7 +73,7 @@ export async function getS3Response ({ request, response, filename, s3Folder, re } if (s3Object && s3Object.Body) { let content: GetObjectCommandOutput["Body"] | Buffer = s3Object.Body; - log("s3Object: " + s3Object, LogLevel.DEBUG, { ...s3Object, Body: content !== (undefined || null) }); + log("s3Object: " + s3Object, LogLevel.DEBUG, { ...s3Object, Body: !!s3Object.Body }); // res.writeHead and res.send don't mix so we have to set each header separately response.status(200); response.setHeader("Content-Disposition", "inline"); diff --git a/controller/pages/api/util/testmanager.ts b/controller/pages/api/util/testmanager.ts index 7e0b6645..9914334c 100644 --- a/controller/pages/api/util/testmanager.ts +++ b/controller/pages/api/util/testmanager.ts @@ -370,7 +370,7 @@ export async function downloadPriorTestId ( fieldAdditionalFiles = parsedAdditionalFiles as string[]; } } catch (error) { - log("Could not parse fieldAdditionalFiles: " + fieldAdditionalFiles, LogLevel.WARN, fieldAdditionalFiles); + log("Could not parse fieldAdditionalFiles: " + fieldAdditionalFiles, LogLevel.WARN, error, fieldAdditionalFiles); } } additionalFileNames.push(...fieldAdditionalFiles); diff --git a/controller/pages/index.tsx b/controller/pages/index.tsx index 43b5788a..745f36f4 100644 --- a/controller/pages/index.tsx +++ b/controller/pages/index.tsx @@ -205,7 +205,7 @@ const TestStatusPage = ({ }); // Sanitized the search const searchString = state.testIdSearch; - // eslint-disable-next-line no-useless-escape + if (!SEARCH_REGEX.test(searchString)) { setState({ error: "Only Alphanumeric characters are allowed" diff --git a/controller/test/ppaasencryptenvfile.spec.ts b/controller/test/ppaasencryptenvfile.spec.ts index eb69ab74..db347618 100644 --- a/controller/test/ppaasencryptenvfile.spec.ts +++ b/controller/test/ppaasencryptenvfile.spec.ts @@ -325,7 +325,7 @@ describe("PpaasEncryptEnvironmentFile", () => { expect(JSON.stringify(sanitizedCopy.getEnvironmentVariables()), "getEnvironmentVariables()").to.equal("{}"); done(); } catch (error) { - done(); + done(error); } }); diff --git a/controller/test/ppaasencrypts3file.spec.ts b/controller/test/ppaasencrypts3file.spec.ts index d3447e4d..66352e53 100644 --- a/controller/test/ppaasencrypts3file.spec.ts +++ b/controller/test/ppaasencrypts3file.spec.ts @@ -169,7 +169,7 @@ describe("PpaasEncryptS3File", () => { expect(sanitizedCopy.getFileContents(), "getFileContents()").to.equal(undefined); done(); } catch (error) { - done(); + done(error); } }); diff --git a/eslint.config.mjs b/eslint.config.mjs index 289b8c46..f45b2706 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -29,6 +29,7 @@ export default [{ "controller/storybook-static", "controller/.storybook", "controller/**/**.js", + "controller/next-env.d.t", "eslint.config.mjs" ], }, ...compat.extends(