diff --git a/.vscode/settings.json b/.vscode/settings.json index 2f1c27db..0d559e2d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -23,10 +23,7 @@ ], "json.schemas": [ { - "fileMatch": [ - ".ncurc", - ".ncurc.json" - ], + "fileMatch": [".ncurc", ".ncurc.json"], "url": "https://raw.githubusercontent.com/raineorshine/npm-check-updates/main/src/types/RunOptions.json" } ], @@ -38,9 +35,7 @@ "https://json.schemastore.org/github-workflow.json": [ ".github/workflows/node.js.yml" ], - "https://json.schemastore.org/lefthook.json": [ - "lefthook.yml" - ], + "https://json.schemastore.org/lefthook.json": ["lefthook.yml"], "https://raw.githubusercontent.com/raineorshine/npm-check-updates/main/src/types/RunOptions.json": [ ".ncurc.yml" ] @@ -52,4 +47,4 @@ "[json]": { "editor.defaultFormatter": "biomejs.biome" } -} \ No newline at end of file +} diff --git a/biome.jsonc b/biome.jsonc index 574d753a..fec709b5 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -7,11 +7,7 @@ }, "files": { "ignoreUnknown": false, - "ignore": [ - "**/wsdot-web-styles/**", - "tests/routes.json", - "*.arcade" - ] + "ignore": ["**/wsdot-web-styles/**", "tests/routes.json", "*.arcade"] }, "formatter": { "enabled": true, @@ -31,4 +27,4 @@ "quoteStyle": "double" } } -} \ No newline at end of file +} diff --git a/src/layers/MilepostLayer/milepost-line-layer/MilepostOffsetLineRenderer.ts b/src/layers/MilepostLayer/milepost-line-layer/MilepostOffsetLineRenderer.ts index ce3914b7..f9f693e8 100644 --- a/src/layers/MilepostLayer/milepost-line-layer/MilepostOffsetLineRenderer.ts +++ b/src/layers/MilepostLayer/milepost-line-layer/MilepostOffsetLineRenderer.ts @@ -1,5 +1,5 @@ -import MilepostLocationRenderer from "./Milepost Location Renderer.json"; import SimpleRenderer from "@arcgis/core/renderers/SimpleRenderer"; +import MilepostLocationRenderer from "./Milepost Location Renderer.json"; /** * Simple Renderer using a CIM symbol. diff --git a/src/setupPopupActions.ts b/src/setupPopupActions.ts index a9277169..ef20abdd 100644 --- a/src/setupPopupActions.ts +++ b/src/setupPopupActions.ts @@ -31,16 +31,17 @@ export function setupPopupActions(view: __esri.MapView) { document.body.append(alert); const copyPointToClipboard = (point: __esri.Point) => { + let projectedPoint = point; const { spatialReference } = point; if (spatialReference.isWebMercator) { - point = webMercatorToGeographic(point) as __esri.Point; + projectedPoint = webMercatorToGeographic(point) as __esri.Point; } else if (!spatialReference.isWGS84) { throw new Error( `Unsupported spatial reference: ${spatialReference.wkid}`, ); } - const { x, y } = point; + const { x, y } = projectedPoint; messageElement.textContent = `Copied ${[y, x].map((x) => x.toFixed(3)).join(",")} to clipboard.`; navigator.clipboard diff --git a/src/widgets/LoadingIndicator.ts b/src/widgets/LoadingIndicator.ts index 28b6ce42..8d516aec 100644 --- a/src/widgets/LoadingIndicator.ts +++ b/src/widgets/LoadingIndicator.ts @@ -11,8 +11,7 @@ export function setupViewLoadingIndicator(view: View) { // Add the map loading indicator. view.ui.add(viewProgress, "bottom-trailing"); // Make the view loading indicator only show up when the map is updating. - return view.watch( - "updating", - (updating) => (viewProgress.hidden = !updating), - ); + return view.watch("updating", (updating) => { + viewProgress.hidden = !updating; + }); } diff --git a/tests/CIM.test.ts b/tests/CIM.test.ts index 6d429356..9d775e62 100644 --- a/tests/CIM.test.ts +++ b/tests/CIM.test.ts @@ -1,11 +1,11 @@ -import renderer from "../src/layers/MilepostLayer/milepost-line-layer/MilepostOffsetLineRenderer"; import { describe, test } from "vitest"; +import renderer from "../src/layers/MilepostLayer/milepost-line-layer/MilepostOffsetLineRenderer"; describe.concurrent( - "CIM renderer from JSON exported from ArcGIS Online", - () => { - test("renderer was created successfully", ({ expect }) => { - expect(renderer).toBeDefined(); - }); - }, + "CIM renderer from JSON exported from ArcGIS Online", + () => { + test("renderer was created successfully", ({ expect }) => { + expect(renderer).toBeDefined(); + }); + }, ); diff --git a/tests/milepost-info.test.ts b/tests/milepost-info.test.ts index fa131cf6..3cbe46db 100644 --- a/tests/milepost-info.test.ts +++ b/tests/milepost-info.test.ts @@ -7,16 +7,16 @@ describe.concurrent("getRouteList", () => { const routes = await getRouteList(); expect(routes.length).toBeGreaterThan(0); for (const { RouteID, Direction, MinSrmp, MaxSrmp } of routes) { - [RouteID, Direction].forEach((x) => { + for (const x of [RouteID, Direction]) { expect(x).to.be.a("string"); - }); + } expect(RouteID).length.to.be.at.least(3); expect(RouteID).length.to.not.be.greaterThan(12); expect(Direction).length.to.be.at.least(1); - [MinSrmp, MaxSrmp].forEach((x) => { + for (const x of [MinSrmp, MaxSrmp]) { expect(x).to.be.a("number"); expect(x).to.be.at.least(0); - }); + } } }); });