From b177ca1ba5b8fe1f0861f7e388caaae1afdae44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 29 Sep 2023 11:50:06 +0100 Subject: [PATCH] fix: Linting --- .../components/DrawBoundary/Public/index.tsx | 22 +-- .../FileUploadAndLabel/Editor.test.tsx | 2 +- .../components/FileUploadAndLabel/Modal.tsx | 6 +- .../classifiedRoadsNegativeResponseMock.ts | 2 +- .../mocks/classifiedRoadsResponseMock.ts | 2 +- .../src/@planx/components/Section/Editor.tsx | 5 +- .../@planx/components/Section/Public.test.tsx | 14 +- .../src/@planx/components/Section/Public.tsx | 45 ++++--- editor.planx.uk/src/client/index.ts | 4 +- .../src/components/Header.test.tsx | 4 +- editor.planx.uk/src/components/Header.tsx | 127 +++++++++--------- .../components/Flow/components/Hanger.tsx | 5 +- .../components/Settings/DesignSettings.tsx | 2 +- .../components/Settings/ServiceFlags.tsx | 2 +- .../src/pages/FlowEditor/lib/store/editor.ts | 4 +- .../src/pages/FlowEditor/lib/store/user.ts | 7 +- editor.planx.uk/src/ui/ImgInput.tsx | 2 +- editor.planx.uk/src/ui/ListManager.tsx | 2 +- 18 files changed, 143 insertions(+), 114 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx index 0d3f450282..7850e0bf32 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx @@ -12,7 +12,7 @@ import QuestionHeader from "@planx/components/shared/Preview/QuestionHeader"; import { PrivateFileUpload } from "@planx/components/shared/PrivateFileUpload/PrivateFileUpload"; import type { PublicProps } from "@planx/components/ui"; import buffer from "@turf/buffer"; -import { type GeometryObject,point } from "@turf/helpers"; +import { type GeometryObject, point } from "@turf/helpers"; import { Store, useStore } from "pages/FlowEditor/lib/store"; import React, { useEffect, useRef, useState } from "react"; import { FONT_WEIGHT_SEMI_BOLD } from "theme"; @@ -42,10 +42,13 @@ export default function Component(props: Props) { const [boundary, setBoundary] = useState(previousBoundary); const [slots, setSlots] = useState(previousFile ?? []); const [area, setArea] = useState(previousArea); - const addressPoint = passport?.data?._address?.longitude && passport?.data?._address?.latitude && point([ - Number(passport?.data?._address?.longitude), - Number(passport?.data?._address?.latitude), - ]); + const addressPoint = + passport?.data?._address?.longitude && + passport?.data?._address?.latitude && + point([ + Number(passport?.data?._address?.longitude), + Number(passport?.data?._address?.latitude), + ]); const environment = useStore((state) => state.previewEnvironment); useEffect(() => { @@ -120,9 +123,12 @@ export default function Component(props: Props) { drawMode drawPointer="crosshair" drawGeojsonData={JSON.stringify(boundary)} - clipGeojsonData={addressPoint && JSON.stringify( - buffer(addressPoint, BUFFER_IN_METERS, { units: "meters" }), - )} + clipGeojsonData={ + addressPoint && + JSON.stringify( + buffer(addressPoint, BUFFER_IN_METERS, { units: "meters" }), + ) + } zoom={20} maxZoom={23} latitude={Number(passport?.data?._address?.latitude)} diff --git a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.test.tsx b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.test.tsx index c14b559f7c..4b8d71140a 100644 --- a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.test.tsx +++ b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Editor.test.tsx @@ -1,11 +1,11 @@ import { screen } from "@testing-library/react"; +import { vanillaStore } from "pages/FlowEditor/lib/store"; import React from "react"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; import { setup } from "testUtils"; import FileUploadAndLabelComponent from "./Editor"; -import { vanillaStore } from "pages/FlowEditor/lib/store"; const { getState } = vanillaStore; diff --git a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Modal.tsx b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Modal.tsx index e6008a3f90..5e6ddedd4b 100644 --- a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Modal.tsx +++ b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Modal.tsx @@ -285,7 +285,11 @@ const SelectMultiple = (props: SelectMultipleProps) => { Select all labels that apply - diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/classifiedRoadsNegativeResponseMock.ts b/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/classifiedRoadsNegativeResponseMock.ts index 4a51847ec0..6a18b0aac0 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/classifiedRoadsNegativeResponseMock.ts +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/classifiedRoadsNegativeResponseMock.ts @@ -7,7 +7,7 @@ export default { "road.classified": { name: "Classified road", plural: "Classified roads", - text: "This will effect your project if you are looking to add a dropped kerb. It may also impact some agricultural or forestry projects within 25 metres of a classified road." + text: "This will effect your project if you are looking to add a dropped kerb. It may also impact some agricultural or forestry projects within 25 metres of a classified road.", }, }, constraints: { diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/classifiedRoadsResponseMock.ts b/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/classifiedRoadsResponseMock.ts index 8296d32838..155d3c782d 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/classifiedRoadsResponseMock.ts +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/classifiedRoadsResponseMock.ts @@ -7,7 +7,7 @@ export default { "road.classified": { name: "Classified road", plural: "Classified roads", - text: "This will effect your project if you are looking to add a dropped kerb. It may also impact some agricultural or forestry projects within 25 metres of a classified road." + text: "This will effect your project if you are looking to add a dropped kerb. It may also impact some agricultural or forestry projects within 25 metres of a classified road.", }, }, constraints: { diff --git a/editor.planx.uk/src/@planx/components/Section/Editor.tsx b/editor.planx.uk/src/@planx/components/Section/Editor.tsx index da6e3d4ee0..f0f5c13334 100644 --- a/editor.planx.uk/src/@planx/components/Section/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Section/Editor.tsx @@ -28,10 +28,7 @@ function SectionComponent(props: Props) { return (