From e1c5ec1793c7b2091e23289994c6f2863d12b64d Mon Sep 17 00:00:00 2001 From: Trevor McMaster Date: Fri, 15 Mar 2024 14:12:08 -0600 Subject: [PATCH] Added eslint key-spacing rule --- .eslintrc | 1 + agent/test/pewpewtest.spec.ts | 2 +- controller/components/StartTestForm/index.tsx | 2 +- controller/components/TestInfo/index.tsx | 2 +- guide/results-viewer-react/.eslintrc | 1 + guide/results-viewer-react/src/components/Modal/story.tsx | 2 +- guide/results-viewer-react/src/components/YamlUrls/story.tsx | 4 ++-- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3bf36364..52083e88 100644 --- a/.eslintrc +++ b/.eslintrc @@ -63,6 +63,7 @@ "space-infix-ops":"warn", "space-before-blocks": "warn", "keyword-spacing": "warn", + "key-spacing": 1, "strict": 1, "comma-dangle": 1, "triple-equals": 0, diff --git a/agent/test/pewpewtest.spec.ts b/agent/test/pewpewtest.spec.ts index 17b6cb2c..2b1ab17f 100644 --- a/agent/test/pewpewtest.spec.ts +++ b/agent/test/pewpewtest.spec.ts @@ -190,7 +190,7 @@ describe("PewPewTest", () => { endTime: now + 2, resultsFilename: ["test2"], status: TestStatus.Failed, - version:"version3", + version: "version3", userId: "user3" }; diff --git a/controller/components/StartTestForm/index.tsx b/controller/components/StartTestForm/index.tsx index 9734d1ec..67bdc8a4 100644 --- a/controller/components/StartTestForm/index.tsx +++ b/controller/components/StartTestForm/index.tsx @@ -174,7 +174,7 @@ export const StartTestForm = ({ allDays: defaultDaysOfWeek.every((dayOfWeek: DayValue) => dayOfWeek.value), queueName: previousTestData?.queueName || queueInitialProps.queueName, pewpewVersion: previousTestData?.version || (recurringTest ? maxPewPewVersion : versionInitalProps.pewpewVersion), - environmentVariables: previousTestData?.environmentVariables + environmentVariables: previousTestData?.environmentVariables ? Object.entries(previousTestData.environmentVariables).map(([variableName, variableValue]: [string, string | null], index: number) => ({ // Map these to the placeholder values name: "previousVar" + index, // We can't use the date or we'll get constant redraws, use the index diff --git a/controller/components/TestInfo/index.tsx b/controller/components/TestInfo/index.tsx index db4e42d6..22efcd6a 100644 --- a/controller/components/TestInfo/index.tsx +++ b/controller/components/TestInfo/index.tsx @@ -54,7 +54,7 @@ export const TestInfo = ({ testData, ...testInfoProps }: TestInfoProps) => { const defaultState: TestInfoState = { message: testInfoProps.message || undefined, messageId: testInfoProps.messageId || undefined, - killTest : testInfoProps.killTest || undefined, + killTest: testInfoProps.killTest || undefined, error: testInfoProps.error || undefined }; const [state, setState] = useState(defaultState); diff --git a/guide/results-viewer-react/.eslintrc b/guide/results-viewer-react/.eslintrc index f5a20c45..b35016bd 100644 --- a/guide/results-viewer-react/.eslintrc +++ b/guide/results-viewer-react/.eslintrc @@ -50,6 +50,7 @@ "space-infix-ops":"warn", "space-before-blocks": "warn", "keyword-spacing": "warn", + "key-spacing": 1, "strict": 1, "comma-dangle": 1, "triple-equals": 0, diff --git a/guide/results-viewer-react/src/components/Modal/story.tsx b/guide/results-viewer-react/src/components/Modal/story.tsx index 3ad4147a..fccf8c7b 100644 --- a/guide/results-viewer-react/src/components/Modal/story.tsx +++ b/guide/results-viewer-react/src/components/Modal/story.tsx @@ -63,7 +63,7 @@ const ModalUploadHarDemo = () => {
{files.map((file, index) => (
- + {file.name}
))} diff --git a/guide/results-viewer-react/src/components/YamlUrls/story.tsx b/guide/results-viewer-react/src/components/YamlUrls/story.tsx index 226e6cc0..7f6dfc5a 100644 --- a/guide/results-viewer-react/src/components/YamlUrls/story.tsx +++ b/guide/results-viewer-react/src/components/YamlUrls/story.tsx @@ -45,9 +45,9 @@ const propsLoaded: UrlProps = { url: "https://www.pewpew.org", hitRate: "1hpm", headers: [ - {id: "0", name : "Default Header", value: "Here is where default headers are. These next 3 are the only default. Authorization header only shows up when Authenticated button is selected"}, + {id: "0", name: "Default Header", value: "Here is where default headers are. These next 3 are the only default. Authorization header only shows up when Authenticated button is selected"}, ...getDefaultHeaders(true), - {id: "1", name : "Har Header", value: "Here is where har headers would be"} + {id: "1", name: "Har Header", value: "Here is where har headers would be"} ], method: "GET", authorization: null },