From 47c9c9578400e570b90e15cc15e38f5a291a9201 Mon Sep 17 00:00:00 2001 From: Bilal Mahmoud <7252775+indietyp@users.noreply.github.com> Date: Tue, 6 Oct 2026 20:07:26 +0200 Subject: [PATCH 01/13] chore: switch to TypeScript 7 with TypeScript 6 compatibility --- .yarnrc.yml | 2 +- apps/brunch-agent/package.json | 4 +- apps/petrinaut-website/api/tsconfig.json | 1 + apps/petrinaut-website/package.json | 4 +- libs/@blockprotocol/graph/package.json | 5 +- .../preprocess/transform-type-titles.ts | 2 +- libs/@hashintel/brunch-agent/package.json | 4 +- libs/@hashintel/ds-icons/AGENTS.md | 2 +- libs/@hashintel/ds-icons/package.json | 4 +- libs/@hashintel/petrinaut-cli/package.json | 4 +- libs/@hashintel/petrinaut-core/package.json | 3 +- libs/@hashintel/petrinaut/AGENTS.md | 4 +- libs/@hashintel/petrinaut/package.json | 4 +- .../petrinaut/src/ui/fontsource.d.ts | 2 +- libs/@hashintel/refractive/package.json | 4 +- libs/@local/flue-aisdk-transport/package.json | 4 +- libs/@local/pi-faux-providers/package.json | 6 +- .../petrinaut-brunch-integration/package.json | 4 +- yarn.lock | 341 ++++++++++++++---- 19 files changed, 298 insertions(+), 106 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index e355d391d1c..9721ee52909 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -39,7 +39,7 @@ packageExtensions: catalog: tsx: "4.20.6" - typescript: "6.0.3" + typescript: "7.0.2" "@typescript/typescript6": "6.0.2" vite: "8.3.4" vitest: "4.1.11" diff --git a/apps/brunch-agent/package.json b/apps/brunch-agent/package.json index 873150d6ba0..c0a7d4abc63 100644 --- a/apps/brunch-agent/package.json +++ b/apps/brunch-agent/package.json @@ -15,7 +15,7 @@ "dev": "vite dev", "fix:eslint": "oxlint --fix --type-aware --type-check --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --type-check --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "packet:run": "node --experimental-strip-types --disable-warning=ExperimentalWarning evals/petrinaut/run-packet-cli.ts", "persona": "node --experimental-strip-types evals/petrinaut/persona/launch.ts", "petrinaut:dev": "vite dev --config petrinaut-local.vite.config.ts", @@ -61,12 +61,12 @@ "@types/pg": "8.23.1", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "@valibot/to-json-schema": "1.7.1", "ai": "6.0.286", "dependency-cruiser": "18.0.0", "oxlint": "1.86.0", "oxlint-tsgolint": "7.0.2003", + "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:", "wait-on": "9.0.1" diff --git a/apps/petrinaut-website/api/tsconfig.json b/apps/petrinaut-website/api/tsconfig.json index 67e65429def..c85f3d3b3d3 100644 --- a/apps/petrinaut-website/api/tsconfig.json +++ b/apps/petrinaut-website/api/tsconfig.json @@ -6,6 +6,7 @@ "lib": ["DOM", "ESNext"], "moduleResolution": "NodeNext", "noEmit": true, + "rootDir": "..", "verbatimModuleSyntax": true }, "include": ["./**/*.ts"] diff --git a/apps/petrinaut-website/package.json b/apps/petrinaut-website/package.json index 37fd49a4c3c..bdb42298cf8 100644 --- a/apps/petrinaut-website/package.json +++ b/apps/petrinaut-website/package.json @@ -11,7 +11,7 @@ "fix:eslint": "oxlint --fix --type-aware --report-unused-disable-directives-severity=error .", "generate:icons": "node scripts/generate-favicons.mjs", "lint:eslint": "oxlint --type-aware --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit && tsgo --noEmit --project api/tsconfig.json", + "lint:tsc": "tsc --noEmit && tsc --noEmit --project api/tsconfig.json", "preview": "vite preview", "test:unit": "vitest run --passWithNoTests" }, @@ -50,7 +50,6 @@ "@types/node": "catalog:", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "@typescript/typescript6": "catalog:", "@vitejs/plugin-react": "6.1.1", "@whatwg-node/server": "0.10.18", @@ -60,6 +59,7 @@ "oxlint": "1.86.0", "oxlint-tsgolint": "7.0.2003", "sharp": "0.35.5", + "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:" } diff --git a/libs/@blockprotocol/graph/package.json b/libs/@blockprotocol/graph/package.json index 97ebf8193b6..eb03b16bf16 100644 --- a/libs/@blockprotocol/graph/package.json +++ b/libs/@blockprotocol/graph/package.json @@ -71,12 +71,12 @@ "dependencies": { "@blockprotocol/core": "0.1.5", "@blockprotocol/type-system": "workspace:^", + "@typescript/typescript6": "catalog:", "ajv": "8.18.0", "ajv-formats": "3.0.1", "dequal": "2.0.3", "json-schema-to-typescript": "15.0.4", - "lit": "2.8.0", - "typescript": "catalog:" + "lit": "2.8.0" }, "devDependencies": { "@apidevtools/json-schema-ref-parser": "15.1.3", @@ -85,6 +85,7 @@ "@tsconfig/bases": "catalog:", "@types/node": "catalog:", "@types/react": "19.2.14", + "@typescript/typescript6": "catalog:", "eslint": "9.39.4", "rimraf": "6.1.3", "typescript": "catalog:" diff --git a/libs/@blockprotocol/graph/src/codegen/preprocess/transform-type-titles.ts b/libs/@blockprotocol/graph/src/codegen/preprocess/transform-type-titles.ts index 10f0b8232b2..688e972bf91 100644 --- a/libs/@blockprotocol/graph/src/codegen/preprocess/transform-type-titles.ts +++ b/libs/@blockprotocol/graph/src/codegen/preprocess/transform-type-titles.ts @@ -1,4 +1,4 @@ -import ts from "typescript"; +import ts from "@typescript/typescript6"; import { extractBaseUrl, extractVersion } from "@blockprotocol/type-system"; diff --git a/libs/@hashintel/brunch-agent/package.json b/libs/@hashintel/brunch-agent/package.json index 229a4f1ad27..9c637512e67 100644 --- a/libs/@hashintel/brunch-agent/package.json +++ b/libs/@hashintel/brunch-agent/package.json @@ -26,7 +26,7 @@ "build": "vite build", "fix:eslint": "oxlint --fix --type-aware --type-check --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --type-check --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "test:unit": "vitest run" }, "dependencies": { @@ -40,9 +40,9 @@ "@local/tsconfig": "workspace:*", "@tsconfig/bases": "catalog:", "@types/node": "catalog:", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "oxlint": "1.86.0", "oxlint-tsgolint": "7.0.2003", + "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:" } diff --git a/libs/@hashintel/ds-icons/AGENTS.md b/libs/@hashintel/ds-icons/AGENTS.md index 622560ed561..59a8984cee1 100644 --- a/libs/@hashintel/ds-icons/AGENTS.md +++ b/libs/@hashintel/ds-icons/AGENTS.md @@ -23,6 +23,6 @@ It owns: ```sh yarn build # Library, types, preset and Panda build info yarn lint:eslint # Lint with oxlint -yarn lint:tsc # Type check with tsgo +yarn lint:tsc # Type check with tsc yarn test:unit # Unit tests (vitest) ``` diff --git a/libs/@hashintel/ds-icons/package.json b/libs/@hashintel/ds-icons/package.json index 319a00a8f52..809ac15f039 100644 --- a/libs/@hashintel/ds-icons/package.json +++ b/libs/@hashintel/ds-icons/package.json @@ -42,7 +42,7 @@ "dev:lib": "vite build --watch", "fix:eslint": "oxlint --fix --type-aware --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "prepack": "turbo run build:pack", "test:unit": "vitest" }, @@ -56,7 +56,6 @@ "@testing-library/react": "16.3.2", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "@vitejs/plugin-react": "6.1.1", "jsdom": "24.1.3", "oxc-transform-react": "0.152.0", @@ -66,6 +65,7 @@ "react-dom": "19.2.6", "rolldown": "1.2.6", "rolldown-plugin-dts": "0.28.3", + "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:" }, diff --git a/libs/@hashintel/petrinaut-cli/package.json b/libs/@hashintel/petrinaut-cli/package.json index 35688715a82..8a7367d5a92 100644 --- a/libs/@hashintel/petrinaut-cli/package.json +++ b/libs/@hashintel/petrinaut-cli/package.json @@ -14,7 +14,7 @@ "codegen": "tsx scripts/generate-protocol-schemas.ts && oxfmt --write --ignore-path /dev/null schemas/optimization-protocol.schema.json", "fix:eslint": "oxlint --fix --type-aware --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "serve": "node ./dist/cli.js serve", "test:unit": "vitest" }, @@ -26,11 +26,11 @@ "@local/tsconfig": "workspace:*", "@tsconfig/bases": "catalog:", "@types/node": "catalog:", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "oxfmt": "0.71.0", "oxlint": "1.86.0", "oxlint-tsgolint": "7.0.2003", "tsx": "catalog:", + "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:" } diff --git a/libs/@hashintel/petrinaut-core/package.json b/libs/@hashintel/petrinaut-core/package.json index b80c4257cdf..486cbd233f1 100644 --- a/libs/@hashintel/petrinaut-core/package.json +++ b/libs/@hashintel/petrinaut-core/package.json @@ -92,7 +92,7 @@ "build:pack": "node ../../../scripts/check-package-payload.mjs", "fix:eslint": "oxlint --fix --type-aware --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "prepack": "turbo run build:pack", "test:unit": "vitest" }, @@ -112,7 +112,6 @@ "@tsconfig/bases": "catalog:", "@types/js-yaml": "^4", "@types/node": "catalog:", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "@typescript/typescript6": "catalog:", "@webgpu/types": "0.1.71", "oxlint": "1.86.0", diff --git a/libs/@hashintel/petrinaut/AGENTS.md b/libs/@hashintel/petrinaut/AGENTS.md index 5571ea541b2..0429d066da1 100644 --- a/libs/@hashintel/petrinaut/AGENTS.md +++ b/libs/@hashintel/petrinaut/AGENTS.md @@ -5,7 +5,7 @@ Visual editor for Stochastic Dynamic Colored Petri Nets (SDCPN). Published npm p ## Stack - React 19 with React Compiler (oxc-transform-react) -- TypeScript (type-checked with `tsgo`) +- TypeScript (type-checked with `tsc`) - Vite 8 + Rolldown (library build + demo site) - Panda CSS for styling - oxlint for linting @@ -34,7 +34,7 @@ Compiler errors fail the build unless the function opts out. The options are in yarn dev # Dev server (demo site) yarn build # Library build yarn lint:eslint # Lint with oxlint -yarn lint:tsc # Type check with tsgo +yarn lint:tsc # Type check with tsc yarn test:unit # Unit tests (vitest) ``` diff --git a/libs/@hashintel/petrinaut/package.json b/libs/@hashintel/petrinaut/package.json index 3e502e26b8a..219e86b2ab1 100644 --- a/libs/@hashintel/petrinaut/package.json +++ b/libs/@hashintel/petrinaut/package.json @@ -69,7 +69,7 @@ "dev": "bash scripts/dev.sh", "fix:eslint": "oxlint --fix --type-aware --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "prepack": "turbo run build:pack", "test:unit": "vitest" }, @@ -112,7 +112,6 @@ "@types/react": "19.2.14", "@types/react-dom": "19.2.3", "@types/use-sync-external-store": "0.0.6", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "@typescript/typescript6": "catalog:", "@vitejs/plugin-react": "6.1.1", "jsdom": "24.1.3", @@ -124,6 +123,7 @@ "rolldown": "1.2.6", "rolldown-plugin-dts": "0.28.3", "storybook": "10.4.6", + "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:" }, diff --git a/libs/@hashintel/petrinaut/src/ui/fontsource.d.ts b/libs/@hashintel/petrinaut/src/ui/fontsource.d.ts index 9bb324f5a1b..781f7571b56 100644 --- a/libs/@hashintel/petrinaut/src/ui/fontsource.d.ts +++ b/libs/@hashintel/petrinaut/src/ui/fontsource.d.ts @@ -1,4 +1,4 @@ -// tsgo (unlike tsc) requires type declarations for side-effect-only imports. +// TypeScript 6.0+ require type declarations for side-effect-only imports. // Fontsource packages ship CSS only, so we declare the module manually. declare module "@fontsource-variable/jetbrains-mono"; declare module "@fontsource-variable/inter"; diff --git a/libs/@hashintel/refractive/package.json b/libs/@hashintel/refractive/package.json index 1afcba9f29e..548d9867f86 100644 --- a/libs/@hashintel/refractive/package.json +++ b/libs/@hashintel/refractive/package.json @@ -28,7 +28,7 @@ "dev:lib": "vite build --watch", "fix:eslint": "oxlint --fix --type-aware --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "prepack": "turbo run build:pack", "test:unit": "vitest" }, @@ -38,7 +38,6 @@ "@tsconfig/bases": "catalog:", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "@vitejs/plugin-react": "6.1.1", "jsdom": "24.1.3", "oxc-transform-react": "0.152.0", @@ -49,6 +48,7 @@ "rolldown": "1.2.6", "rolldown-plugin-dts": "0.28.3", "storybook": "10.4.6", + "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:" }, diff --git a/libs/@local/flue-aisdk-transport/package.json b/libs/@local/flue-aisdk-transport/package.json index 7910312bf05..b3f53a16ab1 100644 --- a/libs/@local/flue-aisdk-transport/package.json +++ b/libs/@local/flue-aisdk-transport/package.json @@ -21,7 +21,7 @@ "build": "vite build", "fix:eslint": "oxlint --fix --type-aware --type-check --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --type-check --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "test:unit": "vitest run" }, "dependencies": { @@ -34,9 +34,9 @@ "@local/tsconfig": "workspace:*", "@tsconfig/bases": "catalog:", "@types/node": "catalog:", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "oxlint": "1.86.0", "oxlint-tsgolint": "7.0.2003", + "typescript": "catalog:", "valibot": "1.4.2", "vite": "catalog:", "vitest": "catalog:" diff --git a/libs/@local/pi-faux-providers/package.json b/libs/@local/pi-faux-providers/package.json index ba61f97d376..4b73971d53a 100644 --- a/libs/@local/pi-faux-providers/package.json +++ b/libs/@local/pi-faux-providers/package.json @@ -18,7 +18,7 @@ "scripts": { "fix:eslint": "oxlint --fix --type-aware --type-check --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --type-check --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit" + "lint:tsc": "tsc --noEmit" }, "dependencies": { "@earendil-works/pi-ai": "1.2.0" @@ -27,8 +27,8 @@ "@local/tsconfig": "workspace:*", "@tsconfig/bases": "catalog:", "@types/node": "catalog:", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "oxlint": "1.86.0", - "oxlint-tsgolint": "7.0.2003" + "oxlint-tsgolint": "7.0.2003", + "typescript": "catalog:" } } diff --git a/tests/petrinaut-brunch-integration/package.json b/tests/petrinaut-brunch-integration/package.json index f5dafa8aa18..23e3be14ea6 100644 --- a/tests/petrinaut-brunch-integration/package.json +++ b/tests/petrinaut-brunch-integration/package.json @@ -8,7 +8,7 @@ "scripts": { "fix:eslint": "oxlint --fix --type-aware --type-check --report-unused-disable-directives-severity=error .", "lint:eslint": "oxlint --type-aware --type-check --report-unused-disable-directives-severity=error .", - "lint:tsc": "tsgo --noEmit", + "lint:tsc": "tsc --noEmit", "test:integration": "vitest run" }, "dependencies": { @@ -31,10 +31,10 @@ "@types/node": "catalog:", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", - "@typescript/native-preview": "7.0.0-dev.20260511.1", "jsdom": "24.1.3", "oxlint": "1.86.0", "oxlint-tsgolint": "7.0.2003", + "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:" } diff --git a/yarn.lock b/yarn.lock index 2283d49c242..b5951b57fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -418,7 +418,6 @@ __metadata: "@types/pg": "npm:8.23.1" "@types/react": "npm:19.2.14" "@types/react-dom": "npm:19.2.3" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" "@valibot/to-json-schema": "npm:1.7.1" ai: "npm:6.0.286" dependency-cruiser: "npm:18.0.0" @@ -428,6 +427,7 @@ __metadata: pg: "npm:8.23.0" react: "npm:19.2.6" react-dom: "npm:19.2.6" + typescript: "catalog:" valibot: "npm:1.4.2" vite: "catalog:" vitest: "catalog:" @@ -902,7 +902,6 @@ __metadata: "@types/node": "catalog:" "@types/react": "npm:19.2.14" "@types/react-dom": "npm:19.2.3" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" "@typescript/typescript6": "catalog:" "@vitejs/plugin-react": "npm:6.1.1" "@whatwg-node/server": "npm:0.10.18" @@ -919,6 +918,7 @@ __metadata: react-icons: "npm:5.5.0" react-markdown: "npm:10.1.0" sharp: "npm:0.35.5" + typescript: "catalog:" vite: "catalog:" vitest: "catalog:" zod: "npm:4.4.3" @@ -4214,6 +4214,7 @@ __metadata: "@tsconfig/bases": "catalog:" "@types/node": "catalog:" "@types/react": "npm:19.2.14" + "@typescript/typescript6": "catalog:" ajv: "npm:8.18.0" ajv-formats: "npm:3.0.1" dequal: "npm:2.0.3" @@ -7510,10 +7511,10 @@ __metadata: "@local/tsconfig": "workspace:*" "@tsconfig/bases": "catalog:" "@types/node": "catalog:" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" md-pen: "npm:1.2.0" oxlint: "npm:1.86.0" oxlint-tsgolint: "npm:7.0.2003" + typescript: "catalog:" valibot: "npm:1.4.2" vite: "catalog:" vitest: "catalog:" @@ -7636,7 +7637,6 @@ __metadata: "@testing-library/react": "npm:16.3.2" "@types/react": "npm:19.2.14" "@types/react-dom": "npm:19.2.3" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" "@vitejs/plugin-react": "npm:6.1.1" jsdom: "npm:24.1.3" oxc-transform-react: "npm:0.152.0" @@ -7646,6 +7646,7 @@ __metadata: react-dom: "npm:19.2.6" rolldown: "npm:1.2.6" rolldown-plugin-dts: "npm:0.28.3" + typescript: "catalog:" vite: "catalog:" vitest: "catalog:" peerDependencies: @@ -7674,12 +7675,12 @@ __metadata: "@local/tsconfig": "workspace:*" "@tsconfig/bases": "catalog:" "@types/node": "catalog:" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" "@typescript/typescript6": "catalog:" oxfmt: "npm:0.71.0" oxlint: "npm:1.86.0" oxlint-tsgolint: "npm:7.0.2003" tsx: "catalog:" + typescript: "catalog:" vite: "catalog:" vitest: "catalog:" bin: @@ -7698,7 +7699,6 @@ __metadata: "@tsconfig/bases": "catalog:" "@types/js-yaml": "npm:^4" "@types/node": "catalog:" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" "@typescript/typescript6": "catalog:" "@webgpu/types": "npm:0.1.71" elkjs: "npm:0.11.0" @@ -7753,7 +7753,6 @@ __metadata: "@types/react": "npm:19.2.14" "@types/react-dom": "npm:19.2.3" "@types/use-sync-external-store": "npm:0.0.6" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" "@typescript/typescript6": "catalog:" "@vitejs/plugin-react": "npm:6.1.1" "@xyflow/react": "npm:12.10.1" @@ -7772,6 +7771,7 @@ __metadata: rolldown: "npm:1.2.6" rolldown-plugin-dts: "npm:0.28.3" storybook: "npm:10.4.6" + typescript: "catalog:" uplot: "npm:1.6.32" use-sync-external-store: "npm:1.6.0" uuid: "npm:14.0.0" @@ -7826,7 +7826,6 @@ __metadata: "@tsconfig/bases": "catalog:" "@types/react": "npm:19.2.14" "@types/react-dom": "npm:19.2.3" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" "@vitejs/plugin-react": "npm:6.1.1" jsdom: "npm:24.1.3" oxc-transform-react: "npm:0.152.0" @@ -7837,6 +7836,7 @@ __metadata: rolldown: "npm:1.2.6" rolldown-plugin-dts: "npm:0.28.3" storybook: "npm:10.4.6" + typescript: "catalog:" vite: "catalog:" vitest: "catalog:" peerDependencies: @@ -9762,10 +9762,10 @@ __metadata: "@local/tsconfig": "workspace:*" "@tsconfig/bases": "catalog:" "@types/node": "catalog:" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" ai: "npm:6.0.286" oxlint: "npm:1.86.0" oxlint-tsgolint: "npm:7.0.2003" + typescript: "catalog:" valibot: "npm:1.4.2" vite: "catalog:" vitest: "catalog:" @@ -10089,9 +10089,9 @@ __metadata: "@local/tsconfig": "workspace:*" "@tsconfig/bases": "catalog:" "@types/node": "catalog:" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" oxlint: "npm:1.86.0" oxlint-tsgolint: "npm:7.0.2003" + typescript: "catalog:" languageName: unknown linkType: soft @@ -17859,13 +17859,13 @@ __metadata: "@types/node": "catalog:" "@types/react": "npm:19.2.14" "@types/react-dom": "npm:19.2.3" - "@typescript/native-preview": "npm:7.0.0-dev.20260511.1" ai: "npm:6.0.286" jsdom: "npm:24.1.3" oxlint: "npm:1.86.0" oxlint-tsgolint: "npm:7.0.2003" react: "npm:19.2.6" react-dom: "npm:19.2.6" + typescript: "catalog:" vite: "catalog:" vitest: "catalog:" languageName: unknown @@ -19681,94 +19681,153 @@ __metadata: languageName: node linkType: hard -"@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260511.1": - version: 7.0.0-dev.20260511.1 - resolution: "@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260511.1" +"@typescript/old@npm:typescript@^6": + version: 6.0.3 + resolution: "typescript@npm:6.0.3" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/4a25ff5045b984370f48f196b3a0120779b1b343d40b9a68d114ea5e5fff099809b2bb777576991a63a5cd59cf7bffd96ff6fe10afcefbcb8bd6fb96ad4b6606 + languageName: node + linkType: hard + +"@typescript/typescript-aix-ppc64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-aix-ppc64@npm:7.0.2" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@typescript/typescript-darwin-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-darwin-arm64@npm:7.0.2" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260511.1": - version: 7.0.0-dev.20260511.1 - resolution: "@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260511.1" +"@typescript/typescript-darwin-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-darwin-x64@npm:7.0.2" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260511.1": - version: 7.0.0-dev.20260511.1 - resolution: "@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260511.1" +"@typescript/typescript-freebsd-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-freebsd-arm64@npm:7.0.2" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@typescript/typescript-freebsd-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-freebsd-x64@npm:7.0.2" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@typescript/typescript-linux-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-arm64@npm:7.0.2" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260511.1": - version: 7.0.0-dev.20260511.1 - resolution: "@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260511.1" +"@typescript/typescript-linux-arm@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-arm@npm:7.0.2" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260511.1": - version: 7.0.0-dev.20260511.1 - resolution: "@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260511.1" +"@typescript/typescript-linux-loong64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-loong64@npm:7.0.2" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + +"@typescript/typescript-linux-mips64el@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-mips64el@npm:7.0.2" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + +"@typescript/typescript-linux-ppc64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-ppc64@npm:7.0.2" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"@typescript/typescript-linux-riscv64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-riscv64@npm:7.0.2" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"@typescript/typescript-linux-s390x@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-s390x@npm:7.0.2" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"@typescript/typescript-linux-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-linux-x64@npm:7.0.2" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260511.1": - version: 7.0.0-dev.20260511.1 - resolution: "@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260511.1" - conditions: os=win32 & cpu=arm64 +"@typescript/typescript-netbsd-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-netbsd-arm64@npm:7.0.2" + conditions: os=netbsd & cpu=arm64 languageName: node linkType: hard -"@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260511.1": - version: 7.0.0-dev.20260511.1 - resolution: "@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260511.1" - conditions: os=win32 & cpu=x64 +"@typescript/typescript-netbsd-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-netbsd-x64@npm:7.0.2" + conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@typescript/native-preview@npm:7.0.0-dev.20260511.1": - version: 7.0.0-dev.20260511.1 - resolution: "@typescript/native-preview@npm:7.0.0-dev.20260511.1" - dependencies: - "@typescript/native-preview-darwin-arm64": "npm:7.0.0-dev.20260511.1" - "@typescript/native-preview-darwin-x64": "npm:7.0.0-dev.20260511.1" - "@typescript/native-preview-linux-arm": "npm:7.0.0-dev.20260511.1" - "@typescript/native-preview-linux-arm64": "npm:7.0.0-dev.20260511.1" - "@typescript/native-preview-linux-x64": "npm:7.0.0-dev.20260511.1" - "@typescript/native-preview-win32-arm64": "npm:7.0.0-dev.20260511.1" - "@typescript/native-preview-win32-x64": "npm:7.0.0-dev.20260511.1" - dependenciesMeta: - "@typescript/native-preview-darwin-arm64": - optional: true - "@typescript/native-preview-darwin-x64": - optional: true - "@typescript/native-preview-linux-arm": - optional: true - "@typescript/native-preview-linux-arm64": - optional: true - "@typescript/native-preview-linux-x64": - optional: true - "@typescript/native-preview-win32-arm64": - optional: true - "@typescript/native-preview-win32-x64": - optional: true - bin: - tsgo: bin/tsgo.js - checksum: 10c0/b7a770653b042a1b18930d3d7e2a920ad88f9139ad1273666bc8139e39686d0e2f84700ce9be4577dc32d840892eec74e5b13b49265ddc9761542ccaaef181ae +"@typescript/typescript-openbsd-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-openbsd-arm64@npm:7.0.2" + conditions: os=openbsd & cpu=arm64 languageName: node linkType: hard -"@typescript/old@npm:typescript@^6, typescript@npm:6.0.3": - version: 6.0.3 - resolution: "typescript@npm:6.0.3" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10c0/4a25ff5045b984370f48f196b3a0120779b1b343d40b9a68d114ea5e5fff099809b2bb777576991a63a5cd59cf7bffd96ff6fe10afcefbcb8bd6fb96ad4b6606 +"@typescript/typescript-openbsd-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-openbsd-x64@npm:7.0.2" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@typescript/typescript-sunos-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-sunos-x64@npm:7.0.2" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"@typescript/typescript-win32-arm64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-win32-arm64@npm:7.0.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@typescript/typescript-win32-x64@npm:7.0.2": + version: 7.0.2 + resolution: "@typescript/typescript-win32-x64@npm:7.0.2" + conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -42590,6 +42649,77 @@ __metadata: languageName: node linkType: hard +"typescript@npm:7.0.2": + version: 7.0.2 + resolution: "typescript@npm:7.0.2" + dependencies: + "@typescript/typescript-aix-ppc64": "npm:7.0.2" + "@typescript/typescript-darwin-arm64": "npm:7.0.2" + "@typescript/typescript-darwin-x64": "npm:7.0.2" + "@typescript/typescript-freebsd-arm64": "npm:7.0.2" + "@typescript/typescript-freebsd-x64": "npm:7.0.2" + "@typescript/typescript-linux-arm": "npm:7.0.2" + "@typescript/typescript-linux-arm64": "npm:7.0.2" + "@typescript/typescript-linux-loong64": "npm:7.0.2" + "@typescript/typescript-linux-mips64el": "npm:7.0.2" + "@typescript/typescript-linux-ppc64": "npm:7.0.2" + "@typescript/typescript-linux-riscv64": "npm:7.0.2" + "@typescript/typescript-linux-s390x": "npm:7.0.2" + "@typescript/typescript-linux-x64": "npm:7.0.2" + "@typescript/typescript-netbsd-arm64": "npm:7.0.2" + "@typescript/typescript-netbsd-x64": "npm:7.0.2" + "@typescript/typescript-openbsd-arm64": "npm:7.0.2" + "@typescript/typescript-openbsd-x64": "npm:7.0.2" + "@typescript/typescript-sunos-x64": "npm:7.0.2" + "@typescript/typescript-win32-arm64": "npm:7.0.2" + "@typescript/typescript-win32-x64": "npm:7.0.2" + dependenciesMeta: + "@typescript/typescript-aix-ppc64": + optional: true + "@typescript/typescript-darwin-arm64": + optional: true + "@typescript/typescript-darwin-x64": + optional: true + "@typescript/typescript-freebsd-arm64": + optional: true + "@typescript/typescript-freebsd-x64": + optional: true + "@typescript/typescript-linux-arm": + optional: true + "@typescript/typescript-linux-arm64": + optional: true + "@typescript/typescript-linux-loong64": + optional: true + "@typescript/typescript-linux-mips64el": + optional: true + "@typescript/typescript-linux-ppc64": + optional: true + "@typescript/typescript-linux-riscv64": + optional: true + "@typescript/typescript-linux-s390x": + optional: true + "@typescript/typescript-linux-x64": + optional: true + "@typescript/typescript-netbsd-arm64": + optional: true + "@typescript/typescript-netbsd-x64": + optional: true + "@typescript/typescript-openbsd-arm64": + optional: true + "@typescript/typescript-openbsd-x64": + optional: true + "@typescript/typescript-sunos-x64": + optional: true + "@typescript/typescript-win32-arm64": + optional: true + "@typescript/typescript-win32-x64": + optional: true + bin: + tsc: bin/tsc + checksum: 10c0/3dcee51ec8c332492325bcdbf7df48b66668751f127e622ae7d41b6c716eb19184424a45e14f7750f50f340232388b69e6287859155f06a5ce2df76f12cb31cf + languageName: node + linkType: hard + "typescript@npm:~5.4.2": version: 5.4.5 resolution: "typescript@npm:5.4.5" @@ -42620,13 +42750,74 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A6.0.3#optional!builtin": - version: 6.0.3 - resolution: "typescript@patch:typescript@npm%3A6.0.3#optional!builtin::version=6.0.3&hash=5786d5" +"typescript@patch:typescript@npm%3A7.0.2#optional!builtin": + version: 7.0.2 + resolution: "typescript@patch:typescript@npm%3A7.0.2#optional!builtin::version=7.0.2&hash=3bafbf" + dependencies: + "@typescript/typescript-aix-ppc64": "npm:7.0.2" + "@typescript/typescript-darwin-arm64": "npm:7.0.2" + "@typescript/typescript-darwin-x64": "npm:7.0.2" + "@typescript/typescript-freebsd-arm64": "npm:7.0.2" + "@typescript/typescript-freebsd-x64": "npm:7.0.2" + "@typescript/typescript-linux-arm": "npm:7.0.2" + "@typescript/typescript-linux-arm64": "npm:7.0.2" + "@typescript/typescript-linux-loong64": "npm:7.0.2" + "@typescript/typescript-linux-mips64el": "npm:7.0.2" + "@typescript/typescript-linux-ppc64": "npm:7.0.2" + "@typescript/typescript-linux-riscv64": "npm:7.0.2" + "@typescript/typescript-linux-s390x": "npm:7.0.2" + "@typescript/typescript-linux-x64": "npm:7.0.2" + "@typescript/typescript-netbsd-arm64": "npm:7.0.2" + "@typescript/typescript-netbsd-x64": "npm:7.0.2" + "@typescript/typescript-openbsd-arm64": "npm:7.0.2" + "@typescript/typescript-openbsd-x64": "npm:7.0.2" + "@typescript/typescript-sunos-x64": "npm:7.0.2" + "@typescript/typescript-win32-arm64": "npm:7.0.2" + "@typescript/typescript-win32-x64": "npm:7.0.2" + dependenciesMeta: + "@typescript/typescript-aix-ppc64": + optional: true + "@typescript/typescript-darwin-arm64": + optional: true + "@typescript/typescript-darwin-x64": + optional: true + "@typescript/typescript-freebsd-arm64": + optional: true + "@typescript/typescript-freebsd-x64": + optional: true + "@typescript/typescript-linux-arm": + optional: true + "@typescript/typescript-linux-arm64": + optional: true + "@typescript/typescript-linux-loong64": + optional: true + "@typescript/typescript-linux-mips64el": + optional: true + "@typescript/typescript-linux-ppc64": + optional: true + "@typescript/typescript-linux-riscv64": + optional: true + "@typescript/typescript-linux-s390x": + optional: true + "@typescript/typescript-linux-x64": + optional: true + "@typescript/typescript-netbsd-arm64": + optional: true + "@typescript/typescript-netbsd-x64": + optional: true + "@typescript/typescript-openbsd-arm64": + optional: true + "@typescript/typescript-openbsd-x64": + optional: true + "@typescript/typescript-sunos-x64": + optional: true + "@typescript/typescript-win32-arm64": + optional: true + "@typescript/typescript-win32-x64": + optional: true bin: tsc: bin/tsc - tsserver: bin/tsserver - checksum: 10c0/2f25c74e65663c248fa1ade2b8459d9ce5372ff9dad07067310f132966ebec1d93f6c42f0baf77a6b6a7a91460463f708e6887013aaade22111037457c6b25df + checksum: 10c0/6b3cdc369cd829d46e00734ea64233ee84419c2825ad8fe408915adde77abced4b7a2401f7eed517d54a7a4f5d1c1869753cb99018df1c2159c761d9f33483a6 languageName: node linkType: hard From ecbd8b2ea8588ff272dde90cdfa35d36f1e9d6dd Mon Sep 17 00:00:00 2001 From: Bilal Mahmoud <7252775+indietyp@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:24:22 +0200 Subject: [PATCH 02/13] chore: enable TypeScript 6 for ESLint --- .yarnrc.yml | 4 + libs/@local/eslint/package.json | 11 +- yarn.config.cjs | 7 +- yarn.lock | 311 ++++++++++++-------------------- 4 files changed, 129 insertions(+), 204 deletions(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index 9721ee52909..13bff2e834a 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -45,3 +45,7 @@ catalog: vitest: "4.1.11" "@tsconfig/bases": "1.0.28" "@types/node": "22.18.13" + +catalogs: + typescript6: + typescript: "6.0.3" diff --git a/libs/@local/eslint/package.json b/libs/@local/eslint/package.json index 68cd9cbbd31..599d3258910 100644 --- a/libs/@local/eslint/package.json +++ b/libs/@local/eslint/package.json @@ -23,6 +23,8 @@ "@babel/core": "7.29.6", "@babel/eslint-parser": "7.28.4", "@eslint/eslintrc": "3.3.3", + "@typescript-eslint/eslint-plugin": "8.71.0", + "@typescript-eslint/parser": "8.71.0", "effect": "3.21.0", "eslint": "9.39.4", "eslint-config-airbnb": "19.0.4", @@ -38,14 +40,17 @@ "eslint-plugin-storybook": "10.3.1", "eslint-unicorn": "55.0.0", "globals": "16.4.0", - "type-fest": "5.3.1" + "type-fest": "5.3.1", + "typescript": "catalog:typescript6" }, "devDependencies": { "@local/tsconfig": "workspace:*", "@tsconfig/bases": "catalog:", "@types/babel__core": "^7.20.5", "@types/node": "catalog:", - "rimraf": "6.1.3", - "typescript": "catalog:" + "rimraf": "6.1.3" + }, + "installConfig": { + "hoistingLimits": "workspaces" } } diff --git a/yarn.config.cjs b/yarn.config.cjs index 4dafbb0af0b..7917e429f97 100644 --- a/yarn.config.cjs +++ b/yarn.config.cjs @@ -76,7 +76,7 @@ const catalog = JSON.parse( const shouldIgnoreDependencyForConsistency = (dependency) => ignoredDependencies.includes(dependency.ident) || ignoredWorkspaces.includes(dependency.workspace.ident) || - (dependency.ident in catalog && !dependency.range.startsWith("catalog:")) || + (dependency.ident in catalog && dependency.range !== "catalog:") || dependency.type === "peerDependencies"; /** @@ -279,7 +279,10 @@ function enforceDevDependenciesAreProperlyDeclared({ Yarn }) { for (const [key, { commands }] of Object.entries( enforcedDevDependencies, )) { - if (workspace.ident === "@local/eslint" && key === "eslint") { + if ( + workspace.ident === "@local/eslint" && + (key === "eslint" || key === "typescript") + ) { continue; } diff --git a/yarn.lock b/yarn.lock index b5951b57fe5..a593636ed7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5995,7 +5995,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.7.0, @eslint-community/eslint-utils@npm:^4.8.0, @eslint-community/eslint-utils@npm:^4.9.0, @eslint-community/eslint-utils@npm:^4.9.1": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.8.0, @eslint-community/eslint-utils@npm:^4.9.0, @eslint-community/eslint-utils@npm:^4.9.1": version: 4.9.1 resolution: "@eslint-community/eslint-utils@npm:4.9.1" dependencies: @@ -6006,10 +6006,10 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.11.0, @eslint-community/regexpp@npm:^4.12.1, @eslint-community/regexpp@npm:^4.8.0": - version: 4.12.1 - resolution: "@eslint-community/regexpp@npm:4.12.1" - checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 +"@eslint-community/regexpp@npm:^4.11.0, @eslint-community/regexpp@npm:^4.12.1, @eslint-community/regexpp@npm:^4.12.2, @eslint-community/regexpp@npm:^4.8.0": + version: 4.12.2 + resolution: "@eslint-community/regexpp@npm:4.12.2" + checksum: 10c0/fddcbc66851b308478d04e302a4d771d6917a0b3740dc351513c0da9ca2eab8a1adf99f5e0aa7ab8b13fa0df005c81adeee7e63a92f3effd7d367a163b721c2d languageName: node linkType: hard @@ -9714,6 +9714,8 @@ __metadata: "@tsconfig/bases": "catalog:" "@types/babel__core": "npm:^7.20.5" "@types/node": "catalog:" + "@typescript-eslint/eslint-plugin": "npm:8.71.0" + "@typescript-eslint/parser": "npm:8.71.0" effect: "npm:3.21.0" eslint: "npm:9.39.4" eslint-config-airbnb: "npm:19.0.4" @@ -9731,7 +9733,7 @@ __metadata: globals: "npm:16.4.0" rimraf: "npm:6.1.3" type-fest: "npm:5.3.1" - typescript: "catalog:" + typescript: "catalog:typescript6" languageName: unknown linkType: soft @@ -19304,68 +19306,39 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/eslint-plugin@npm:8.50.0" +"@typescript-eslint/eslint-plugin@npm:8.71.0": + version: 8.71.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.71.0" dependencies: - "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:8.50.0" - "@typescript-eslint/type-utils": "npm:8.50.0" - "@typescript-eslint/utils": "npm:8.50.0" - "@typescript-eslint/visitor-keys": "npm:8.50.0" - ignore: "npm:^7.0.0" + "@eslint-community/regexpp": "npm:^4.12.2" + "@typescript-eslint/scope-manager": "npm:8.71.0" + "@typescript-eslint/type-utils": "npm:8.71.0" + "@typescript-eslint/utils": "npm:8.71.0" + "@typescript-eslint/visitor-keys": "npm:8.71.0" + ignore: "npm:^7.0.5" natural-compare: "npm:^1.4.0" - ts-api-utils: "npm:^2.1.0" - peerDependencies: - "@typescript-eslint/parser": ^8.50.0 - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/032038ee029d1e0984e7c189c3e8173dc4fb909c3ab4d272227e62e6d1872eb9853699c72d46e269c0a084f113ea01fa00d4b61620190276b224fa1b5a5cbd80 - languageName: node - linkType: hard - -"@typescript-eslint/parser@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/parser@npm:8.50.0" - dependencies: - "@typescript-eslint/scope-manager": "npm:8.50.0" - "@typescript-eslint/types": "npm:8.50.0" - "@typescript-eslint/typescript-estree": "npm:8.50.0" - "@typescript-eslint/visitor-keys": "npm:8.50.0" - debug: "npm:^4.3.4" + ts-api-utils: "npm:^2.5.0" peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/3bdc9e7b2190285abf7350039056b104725fa70cbd769695717f9948669de4987db7103a7011d33d25d44e9474fe02404746816b8eba72642e17815cb6b0b2e6 + "@typescript-eslint/parser": ^8.71.0 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/cd93b29b572c002a45c335e1eff02522c05c25ec96ce7a88be1e42866e13ac73cf53c4f03b5aad2e6355b32004a4b57ce132a185232719bc38b906a6c38d2b74 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^8.56.0": - version: 8.57.0 - resolution: "@typescript-eslint/parser@npm:8.57.0" +"@typescript-eslint/parser@npm:8.71.0, @typescript-eslint/parser@npm:^8.56.0": + version: 8.71.0 + resolution: "@typescript-eslint/parser@npm:8.71.0" dependencies: - "@typescript-eslint/scope-manager": "npm:8.57.0" - "@typescript-eslint/types": "npm:8.57.0" - "@typescript-eslint/typescript-estree": "npm:8.57.0" - "@typescript-eslint/visitor-keys": "npm:8.57.0" + "@typescript-eslint/scope-manager": "npm:8.71.0" + "@typescript-eslint/types": "npm:8.71.0" + "@typescript-eslint/typescript-estree": "npm:8.71.0" + "@typescript-eslint/visitor-keys": "npm:8.71.0" debug: "npm:^4.4.3" peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/c224e0802cdc42ad7c79553018d6572370eff6539b3cb92220e44da3931dfe7e94a11fcea7d30d9c9366e76d50488c8c9d59002ba52dd6818fdc598280f7990c - languageName: node - linkType: hard - -"@typescript-eslint/project-service@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/project-service@npm:8.50.0" - dependencies: - "@typescript-eslint/tsconfig-utils": "npm:^8.50.0" - "@typescript-eslint/types": "npm:^8.50.0" - debug: "npm:^4.3.4" - peerDependencies: - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/54fdf4c8540eb8e592ab4818345935300bf5776621274cdc8bb942e72e84a4d2566b047b77218f6c851de26eab759c45153a39557ed2c2d1054d180d587d9780 + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/d83a47bfe23642365950863f3e1b2ec2fc7c31bd695f4692b49d10f35db68f7fe9762784102b712d17da5beb9a27d286013eede60ecc6540ee41d21fed3e2a10 languageName: node linkType: hard @@ -19382,16 +19355,16 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/project-service@npm:8.57.0": - version: 8.57.0 - resolution: "@typescript-eslint/project-service@npm:8.57.0" +"@typescript-eslint/project-service@npm:8.71.0": + version: 8.71.0 + resolution: "@typescript-eslint/project-service@npm:8.71.0" dependencies: - "@typescript-eslint/tsconfig-utils": "npm:^8.57.0" - "@typescript-eslint/types": "npm:^8.57.0" + "@typescript-eslint/tsconfig-utils": "npm:^8.71.0" + "@typescript-eslint/types": "npm:^8.71.0" debug: "npm:^4.4.3" peerDependencies: - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/f97c25ad9c39957fc58fba21dbc8ce928d3889f95b0ecc93b477da3ce9bb6057bf866cac8114c0c93c455f68d0fb5b0042dc4771e436f07cd9c975bc61f3221f + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/6d8eef9287393b807bb6b7f3f29c44540c9722650155aa0ee8eec1c466bc7c7831353a2db3fd4ba843da34c3db26fd495b80a1809a7e053b22e4e094a8189e6c languageName: node linkType: hard @@ -19405,16 +19378,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/scope-manager@npm:8.50.0" - dependencies: - "@typescript-eslint/types": "npm:8.50.0" - "@typescript-eslint/visitor-keys": "npm:8.50.0" - checksum: 10c0/62a374aaa0bf7d185be43a4d7dd420d7135ab8f13f5cb4e602e16fdf712f0e00e6ab3fc8a31321e19922d27b867579b0b08c4040b23d528853f4b73e9ebcff3b - languageName: node - linkType: hard - "@typescript-eslint/scope-manager@npm:8.56.1": version: 8.56.1 resolution: "@typescript-eslint/scope-manager@npm:8.56.1" @@ -19425,22 +19388,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:8.57.0, @typescript-eslint/scope-manager@npm:^7.0.0 || ^8.0.0, @typescript-eslint/scope-manager@npm:^8.16.0": - version: 8.57.0 - resolution: "@typescript-eslint/scope-manager@npm:8.57.0" +"@typescript-eslint/scope-manager@npm:8.71.0, @typescript-eslint/scope-manager@npm:^7.0.0 || ^8.0.0, @typescript-eslint/scope-manager@npm:^8.16.0": + version: 8.71.0 + resolution: "@typescript-eslint/scope-manager@npm:8.71.0" dependencies: - "@typescript-eslint/types": "npm:8.57.0" - "@typescript-eslint/visitor-keys": "npm:8.57.0" - checksum: 10c0/a3e1243044f4634a36308f0d027db97ef686ed88cb93183feee1ba0a6de4eaa8824bb63b79075241c0a275d989d5f2641a6341cc785a6c688ee6f0d05c07d723 - languageName: node - linkType: hard - -"@typescript-eslint/tsconfig-utils@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/tsconfig-utils@npm:8.50.0" - peerDependencies: - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/5398d26e4a7bec866cc783f5f329a4fed1bc07cd4d21c5c32929a7524b1ebf8ae8e15ca7a035d1177630d86b614ecd3243d63289228bbe292526dbcbf9fae430 + "@typescript-eslint/types": "npm:8.71.0" + "@typescript-eslint/visitor-keys": "npm:8.71.0" + checksum: 10c0/76f4565e1ba4d64c9053f475fd5eb30f538edbe17b497d9551178705117f114ba233a63e811b61b2f57a1abb426381dac38325936b28a6cd2172d01f9420ee9d languageName: node linkType: hard @@ -19453,28 +19407,28 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/tsconfig-utils@npm:8.57.0, @typescript-eslint/tsconfig-utils@npm:^8.50.0, @typescript-eslint/tsconfig-utils@npm:^8.56.1, @typescript-eslint/tsconfig-utils@npm:^8.57.0": - version: 8.57.0 - resolution: "@typescript-eslint/tsconfig-utils@npm:8.57.0" +"@typescript-eslint/tsconfig-utils@npm:8.71.0, @typescript-eslint/tsconfig-utils@npm:^8.56.1, @typescript-eslint/tsconfig-utils@npm:^8.71.0": + version: 8.71.0 + resolution: "@typescript-eslint/tsconfig-utils@npm:8.71.0" peerDependencies: - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/d63f4de1a9d39c208b05a93df838318ff48af0a6ae561395d1860a8fd1fc552d47cc08065c445e084fb67bfac1c5a477183213477ed2bca688b9409cbeda3965 + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/c35af95cad4114cef15b3d9c18fa8c31735062a0cfef41fa5ef18ead1540de314f3f426996abacbb31a44a5317e8cd5fa1e08c3416ded86e4a63393ce5683ef3 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:8.50.0, @typescript-eslint/type-utils@npm:^8.0.0, @typescript-eslint/type-utils@npm:^8.16.0": - version: 8.50.0 - resolution: "@typescript-eslint/type-utils@npm:8.50.0" +"@typescript-eslint/type-utils@npm:8.71.0, @typescript-eslint/type-utils@npm:^8.0.0, @typescript-eslint/type-utils@npm:^8.16.0": + version: 8.71.0 + resolution: "@typescript-eslint/type-utils@npm:8.71.0" dependencies: - "@typescript-eslint/types": "npm:8.50.0" - "@typescript-eslint/typescript-estree": "npm:8.50.0" - "@typescript-eslint/utils": "npm:8.50.0" - debug: "npm:^4.3.4" - ts-api-utils: "npm:^2.1.0" + "@typescript-eslint/types": "npm:8.71.0" + "@typescript-eslint/typescript-estree": "npm:8.71.0" + "@typescript-eslint/utils": "npm:8.71.0" + debug: "npm:^4.4.3" + ts-api-utils: "npm:^2.5.0" peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/7ebd9a1ebd0cbb6eca9864439f80c2432545bd3ac38dee706be0004c78a26a9908003aa4f0825c0745f4fa1356ffacc0848dd230eae22a6516a02710ab645157 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/06502ba733d33ab8dffa43f71440e4bc1517066c23bf9b3659e3c6733cb932e97c7c497edfe6e3f9200cd44be3cbb2a905f0d2ce71212600123c146fc7f65005 languageName: node linkType: hard @@ -19485,13 +19439,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/types@npm:8.50.0" - checksum: 10c0/15ec0d75deb331c5ccda726ad95d7f2801fde0f5edfe70425bbdede9e3c9e93b18e7890c9bc42f86ebd65221ebce75e6cc536a65cb1fbbdb0763df22ac392c7a - languageName: node - linkType: hard - "@typescript-eslint/types@npm:8.56.1": version: 8.56.1 resolution: "@typescript-eslint/types@npm:8.56.1" @@ -19499,10 +19446,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:8.57.0, @typescript-eslint/types@npm:^7.0.0 || ^8.0.0, @typescript-eslint/types@npm:^7.7.1 || ^8, @typescript-eslint/types@npm:^8.16.0, @typescript-eslint/types@npm:^8.50.0, @typescript-eslint/types@npm:^8.56.1, @typescript-eslint/types@npm:^8.57.0": - version: 8.57.0 - resolution: "@typescript-eslint/types@npm:8.57.0" - checksum: 10c0/69eb21a9a550f17ce9445b7bfab9099d6a43fa33f79506df966793077d73423dad7612f33a7efb1e09f4403a889ba6b7a44987cf3e6fea0e63a373022226bc68 +"@typescript-eslint/types@npm:8.71.0, @typescript-eslint/types@npm:^7.0.0 || ^8.0.0, @typescript-eslint/types@npm:^7.7.1 || ^8, @typescript-eslint/types@npm:^8.16.0, @typescript-eslint/types@npm:^8.56.1, @typescript-eslint/types@npm:^8.71.0": + version: 8.71.0 + resolution: "@typescript-eslint/types@npm:8.71.0" + checksum: 10c0/87e62f61cc2499ab7a01f49df205f914f9a8c9d25e80465cce1b0513bb7d8208682376c8e877720998abb8868ca61ede7761265405853c4a64aa0335a0d98db2 languageName: node linkType: hard @@ -19525,25 +19472,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.50.0" - dependencies: - "@typescript-eslint/project-service": "npm:8.50.0" - "@typescript-eslint/tsconfig-utils": "npm:8.50.0" - "@typescript-eslint/types": "npm:8.50.0" - "@typescript-eslint/visitor-keys": "npm:8.50.0" - debug: "npm:^4.3.4" - minimatch: "npm:^9.0.4" - semver: "npm:^7.6.0" - tinyglobby: "npm:^0.2.15" - ts-api-utils: "npm:^2.1.0" - peerDependencies: - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/30344ba5aab687dc50d805c33d4b481cc68c96acdcc679e8a1f46c5b4d8ba1ee562e3f377a4dc1c6418adf5b3fd342b31e5d30e54d0e7b18628ef6b1fb484341 - languageName: node - linkType: hard - "@typescript-eslint/typescript-estree@npm:8.56.1": version: 8.56.1 resolution: "@typescript-eslint/typescript-estree@npm:8.56.1" @@ -19563,52 +19491,37 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.57.0, @typescript-eslint/typescript-estree@npm:^7.0.0 || ^8.0.0, @typescript-eslint/typescript-estree@npm:^8.16.0": - version: 8.57.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.57.0" +"@typescript-eslint/typescript-estree@npm:8.71.0, @typescript-eslint/typescript-estree@npm:^7.0.0 || ^8.0.0, @typescript-eslint/typescript-estree@npm:^8.16.0": + version: 8.71.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.71.0" dependencies: - "@typescript-eslint/project-service": "npm:8.57.0" - "@typescript-eslint/tsconfig-utils": "npm:8.57.0" - "@typescript-eslint/types": "npm:8.57.0" - "@typescript-eslint/visitor-keys": "npm:8.57.0" + "@typescript-eslint/project-service": "npm:8.71.0" + "@typescript-eslint/tsconfig-utils": "npm:8.71.0" + "@typescript-eslint/types": "npm:8.71.0" + "@typescript-eslint/visitor-keys": "npm:8.71.0" debug: "npm:^4.4.3" minimatch: "npm:^10.2.2" semver: "npm:^7.7.3" tinyglobby: "npm:^0.2.15" - ts-api-utils: "npm:^2.4.0" + ts-api-utils: "npm:^2.5.0" peerDependencies: - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/2b72ff255b6711d529496bcae38869e3809b15761252809743d80d01e3efa5a62ebaafc24b96b16a245a8d0bd307958a3e9ab31434d03a87acedbdd5e01c18be + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/3238fcb3933c06fa9f2b8488becc6815c513338a1663427122b5ce6642807a95d3aceb95b3e2c73c934523227d4f90e9a694dfe044b8240c4e4e90214f96eaa8 languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/utils@npm:8.50.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.7.0" - "@typescript-eslint/scope-manager": "npm:8.50.0" - "@typescript-eslint/types": "npm:8.50.0" - "@typescript-eslint/typescript-estree": "npm:8.50.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/4069fbf56717401629c86ea1e36df3a7dc1bbbf5c11ec7b26add2b61cdb9070b48786dc45c8e35a872a0cddced1edef654557e27420b9a666616cead539b3ec0 - languageName: node - linkType: hard - -"@typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/utils@npm:^8.13.0, @typescript-eslint/utils@npm:^8.16.0, @typescript-eslint/utils@npm:^8.18.1, @typescript-eslint/utils@npm:^8.48.0, @typescript-eslint/utils@npm:^8.56.0, @typescript-eslint/utils@npm:^8.8.1": - version: 8.57.0 - resolution: "@typescript-eslint/utils@npm:8.57.0" +"@typescript-eslint/utils@npm:8.71.0, @typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/utils@npm:^8.13.0, @typescript-eslint/utils@npm:^8.16.0, @typescript-eslint/utils@npm:^8.18.1, @typescript-eslint/utils@npm:^8.48.0, @typescript-eslint/utils@npm:^8.56.0, @typescript-eslint/utils@npm:^8.8.1": + version: 8.71.0 + resolution: "@typescript-eslint/utils@npm:8.71.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.9.1" - "@typescript-eslint/scope-manager": "npm:8.57.0" - "@typescript-eslint/types": "npm:8.57.0" - "@typescript-eslint/typescript-estree": "npm:8.57.0" + "@typescript-eslint/scope-manager": "npm:8.71.0" + "@typescript-eslint/types": "npm:8.71.0" + "@typescript-eslint/typescript-estree": "npm:8.71.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/d2c5803a7eaae71ce4cf1435fdc0ab0243e8924647b39bc823e42bc7604f6e01cdcb101eaf9c0eec91fe1bd272e5533041b8a40017679b164be11f32242f292b + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/6d682bc7d578d3266a553559c603a22cd4408b6db321653d5f179b955555c3287f0bb37e6bbcff5f1c485ba11a292e74c5fcd7da60a4b0c492b6365dad48a155 languageName: node linkType: hard @@ -19651,16 +19564,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:8.50.0": - version: 8.50.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.50.0" - dependencies: - "@typescript-eslint/types": "npm:8.50.0" - eslint-visitor-keys: "npm:^4.2.1" - checksum: 10c0/a13337ecc2042229b922b03882d6691df63053445aa8860f6fcc1da59d04d05f75d4e0ee132551b76d5c5f665e881eb89f327a6f0e83240860f913dff5d745ee - languageName: node - linkType: hard - "@typescript-eslint/visitor-keys@npm:8.56.1": version: 8.56.1 resolution: "@typescript-eslint/visitor-keys@npm:8.56.1" @@ -19671,17 +19574,17 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:8.57.0": - version: 8.57.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.57.0" +"@typescript-eslint/visitor-keys@npm:8.71.0": + version: 8.71.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.71.0" dependencies: - "@typescript-eslint/types": "npm:8.57.0" + "@typescript-eslint/types": "npm:8.71.0" eslint-visitor-keys: "npm:^5.0.0" - checksum: 10c0/4e585126b7b10f04c8d52166a473b715038793c87c7b7a1dbd0f577b017896db8545d6ea13bd191c12cf951dfdac23884b3e9bf0bb6f44afea38ae9eae5d7a6a + checksum: 10c0/0797c64e03402d04bac7dabf797cd36dc5e36a7bf1f2aaad063730af8be315ab41529962b5c58d4fca17890c64b32c12e3c8e62876f43f91acd0706421815f03 languageName: node linkType: hard -"@typescript/old@npm:typescript@^6": +"@typescript/old@npm:typescript@^6, typescript@npm:6.0.3": version: 6.0.3 resolution: "typescript@npm:6.0.3" bin: @@ -30532,7 +30435,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:7.0.5, ignore@npm:^7.0.0, ignore@npm:^7.0.5": +"ignore@npm:7.0.5, ignore@npm:^7.0.5": version: 7.0.5 resolution: "ignore@npm:7.0.5" checksum: 10c0/ae00db89fe873064a093b8999fe4cc284b13ef2a178636211842cceb650b9c3e390d3339191acb145d81ed5379d2074840cf0c33a20bdbd6f32821f79eb4ad5d @@ -42171,12 +42074,12 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^2.1.0, ts-api-utils@npm:^2.4.0": - version: 2.4.0 - resolution: "ts-api-utils@npm:2.4.0" +"ts-api-utils@npm:^2.4.0, ts-api-utils@npm:^2.5.0": + version: 2.5.0 + resolution: "ts-api-utils@npm:2.5.0" peerDependencies: typescript: ">=4.8.4" - checksum: 10c0/ed185861aef4e7124366a3f6561113557a57504267d4d452a51e0ba516a9b6e713b56b4aeaab9fa13de9db9ab755c65c8c13a777dba9133c214632cb7b65c083 + checksum: 10c0/767849383c114e7f1971fa976b20e73ac28fd0c70d8d65c0004790bf4d8f89888c7e4cf6d5949f9c1beae9bc3c64835bef77bbe27fddf45a3c7b60cebcf85c8c languageName: node linkType: hard @@ -42615,17 +42518,17 @@ __metadata: linkType: hard "typescript-eslint@npm:^8.46.4": - version: 8.50.0 - resolution: "typescript-eslint@npm:8.50.0" + version: 8.71.0 + resolution: "typescript-eslint@npm:8.71.0" dependencies: - "@typescript-eslint/eslint-plugin": "npm:8.50.0" - "@typescript-eslint/parser": "npm:8.50.0" - "@typescript-eslint/typescript-estree": "npm:8.50.0" - "@typescript-eslint/utils": "npm:8.50.0" + "@typescript-eslint/eslint-plugin": "npm:8.71.0" + "@typescript-eslint/parser": "npm:8.71.0" + "@typescript-eslint/typescript-estree": "npm:8.71.0" + "@typescript-eslint/utils": "npm:8.71.0" peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <6.0.0" - checksum: 10c0/63f96505fdfc7d0ff0b5d0338c5877a76ef0933ea3a0c90b2a5d73a7f0ee18d778dc673d9345de3bcb6f37ae02fd930301ef13b2e162c4850f08ad89f1c19613 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: ">=4.8.4 <6.1.0" + checksum: 10c0/a9ffeaf63f3a85514dfd63fd9c7cfb778bdea59488b013f49e6c8771327be42b895abe686d89f706eb7dae0f624487ae21ddfa799bbc891390449a173e9f99a4 languageName: node linkType: hard @@ -42750,6 +42653,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A6.0.3#optional!builtin": + version: 6.0.3 + resolution: "typescript@patch:typescript@npm%3A6.0.3#optional!builtin::version=6.0.3&hash=5786d5" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/2f25c74e65663c248fa1ade2b8459d9ce5372ff9dad07067310f132966ebec1d93f6c42f0baf77a6b6a7a91460463f708e6887013aaade22111037457c6b25df + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A7.0.2#optional!builtin": version: 7.0.2 resolution: "typescript@patch:typescript@npm%3A7.0.2#optional!builtin::version=7.0.2&hash=3bafbf" From d72fe1fd9e1f43a8edd7dc022633cd92b557d3c4 Mon Sep 17 00:00:00 2001 From: Bilal Mahmoud <7252775+indietyp@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:55:12 +0200 Subject: [PATCH 03/13] chore: modernize TypeScript build tooling --- .yarnrc.yml | 8 +- apps/petrinaut-docs/package.json | 2 +- apps/plugin-browser/package.json | 5 +- apps/plugin-browser/tsconfig.json | 3 +- apps/plugin-browser/webpack.config.js | 11 +- .../type-system/typescript/eslint.config.js | 2 +- .../type-system/typescript/package.json | 10 +- .../type-system/typescript/rolldown.config.js | 68 +++ .../type-system/typescript/rollup.config.js | 85 ---- .../typescript/src/native/entity.ts | 2 +- .../typescript/tsconfig.build.json | 7 + .../type-system/typescript/tsconfig.dist.json | 10 + yarn.lock | 387 ++---------------- 13 files changed, 137 insertions(+), 463 deletions(-) create mode 100644 libs/@blockprotocol/type-system/typescript/rolldown.config.js delete mode 100644 libs/@blockprotocol/type-system/typescript/rollup.config.js create mode 100644 libs/@blockprotocol/type-system/typescript/tsconfig.build.json create mode 100644 libs/@blockprotocol/type-system/typescript/tsconfig.dist.json diff --git a/.yarnrc.yml b/.yarnrc.yml index 13bff2e834a..725b01da27d 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -30,9 +30,13 @@ npmPreapprovedPackages: - "@earendil-works/pi-ai@1.2.0" - "@earendil-works/pi-telemetry@1.2.0" -# Native tool input public declarations in the pinned local runtime patch. -# Patch manifest edits alone do not add dependencies during Yarn resolution. packageExtensions: + # Pass the checker's compiler through to Volar instead of resolving native TS7. + "@astrojs/language-server@2.16.13": + peerDependencies: + typescript: "^5.0.0 || ^6.0.0" + # Native tool input public declarations in the pinned local runtime patch. + # Patch manifest edits alone do not add dependencies during Yarn resolution. "@flue/runtime@2.3.0": dependencies: "@standard-schema/spec": "1.1.0" diff --git a/apps/petrinaut-docs/package.json b/apps/petrinaut-docs/package.json index d64367cbd9d..9647fc19f82 100644 --- a/apps/petrinaut-docs/package.json +++ b/apps/petrinaut-docs/package.json @@ -31,7 +31,7 @@ "@types/react": "19.2.14", "@types/react-dom": "19.2.3", "hast-util-from-html": "2.0.3", - "typescript": "catalog:", + "typescript": "catalog:typescript6", "unist-util-visit": "5.1.0" }, "engines": { diff --git a/apps/plugin-browser/package.json b/apps/plugin-browser/package.json index 1441b6f5315..e3421da44b1 100644 --- a/apps/plugin-browser/package.json +++ b/apps/plugin-browser/package.json @@ -67,6 +67,7 @@ "@types/react-dom": "19.2.3", "@types/webextension-polyfill": "0.12.4", "@types/ws": "8.18.1", + "@typescript/typescript6": "catalog:", "babel-loader": "10.0.0", "babel-preset-react-app": "10.1.0", "copy-webpack-plugin": "14.0.0", @@ -79,14 +80,14 @@ "html-webpack-plugin": "5.6.4", "process": "0.11.10", "react-refresh": "0.18.0", - "react-refresh-typescript": "2.0.11", + "react-refresh-typescript": "2.0.12", "rimraf": "6.1.3", "sass": "1.93.2", "sass-loader": "13.3.3", "source-map-loader": "3.0.2", "style-loader": "3.3.4", "terser-webpack-plugin": "5.4.0", - "ts-loader": "9.5.4", + "ts-loader": "9.6.2", "type-fest": "5.3.1", "typescript": "catalog:", "webpack": "5.104.1", diff --git a/apps/plugin-browser/tsconfig.json b/apps/plugin-browser/tsconfig.json index 6606754c39c..e496b54a4a8 100644 --- a/apps/plugin-browser/tsconfig.json +++ b/apps/plugin-browser/tsconfig.json @@ -2,8 +2,9 @@ "extends": ["@tsconfig/bases/recommended", "@local/tsconfig/policy.json"], "compilerOptions": { "jsx": "react-jsx", - "lib": ["dom", "esnext"], + "lib": ["dom", "dom.iterable", "esnext"], "module": "ESNext", + "noEmit": false, "rootDir": "../..", "target": "ES2021" }, diff --git a/apps/plugin-browser/webpack.config.js b/apps/plugin-browser/webpack.config.js index 0ee81c12049..1a8883d6cd8 100755 --- a/apps/plugin-browser/webpack.config.js +++ b/apps/plugin-browser/webpack.config.js @@ -3,6 +3,7 @@ import { fileURLToPath } from "node:url"; import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin"; import { sentryWebpackPlugin } from "@sentry/webpack-plugin"; +import ts from "@typescript/typescript6"; import CopyWebpackPlugin from "copy-webpack-plugin"; import dotenv from "dotenv-flow"; import fileSystem from "fs-extra"; @@ -124,10 +125,14 @@ const options = { { loader: "ts-loader", options: { + // The loader and Refresh need the JS API, while standalone checks use native TS7. + compiler: fileURLToPath( + import.meta.resolve("@typescript/typescript6"), + ), getCustomTransformers: () => ({ - before: [isDevelopment && ReactRefreshTypeScript()].filter( - Boolean, - ), + before: [ + isDevelopment && ReactRefreshTypeScript({ ts }), + ].filter(Boolean), }), transpileOnly: isDevelopment, }, diff --git a/libs/@blockprotocol/type-system/typescript/eslint.config.js b/libs/@blockprotocol/type-system/typescript/eslint.config.js index ff595171892..e4aac2d3e1d 100644 --- a/libs/@blockprotocol/type-system/typescript/eslint.config.js +++ b/libs/@blockprotocol/type-system/typescript/eslint.config.js @@ -3,7 +3,7 @@ import { createBase } from "@local/eslint/deprecated"; export default [ ...createBase(import.meta.dirname), { - ignores: ["rollup.config.js"], + ignores: ["rolldown.config.js"], }, { rules: { diff --git a/libs/@blockprotocol/type-system/typescript/package.json b/libs/@blockprotocol/type-system/typescript/package.json index d881c27365a..6b719adf57a 100644 --- a/libs/@blockprotocol/type-system/typescript/package.json +++ b/libs/@blockprotocol/type-system/typescript/package.json @@ -23,7 +23,7 @@ "typesVersions": { "*": { "*": [ - "./dist/es-slim/main.d.ts" + "./dist/es/main.d.ts" ], "slim": [ "./dist/es-slim/main-slim.d.ts" @@ -39,7 +39,7 @@ "./wasm": "./dist/wasm/type-system.wasm" }, "scripts": { - "build": "yarn clean && rollup -c --bundleConfigAsCjs", + "build": "yarn clean && rolldown -c && tsc --project tsconfig.dist.json", "build:pack": "node ../../../../scripts/check-package-payload.mjs", "clean": "rimraf ./dist/", "codegen": "node scripts/copy-generated.ts", @@ -58,9 +58,6 @@ "@local/eslint": "workspace:*", "@local/hash-codec": "workspace:*", "@local/tsconfig": "workspace:*", - "@rollup/plugin-commonjs": "29.0.0", - "@rollup/plugin-node-resolve": "16.0.3", - "@rollup/plugin-typescript": "12.3.0", "@rollup/plugin-wasm": "6.2.2", "@tsconfig/bases": "catalog:", "@types/node": "catalog:", @@ -70,7 +67,8 @@ "eslint": "9.39.4", "react": "19.2.6", "rimraf": "6.1.3", - "rollup": "4.59.0", + "rolldown": "1.2.6", + "rolldown-plugin-dts": "0.28.3", "tslib": "2.8.1", "typescript": "catalog:", "vite-plugin-wasm-pack": "0.1.12", diff --git a/libs/@blockprotocol/type-system/typescript/rolldown.config.js b/libs/@blockprotocol/type-system/typescript/rolldown.config.js new file mode 100644 index 00000000000..d78df0e72ff --- /dev/null +++ b/libs/@blockprotocol/type-system/typescript/rolldown.config.js @@ -0,0 +1,68 @@ +import fs from "node:fs"; +import path from "node:path"; + +import { wasm } from "@rollup/plugin-wasm"; +import { defineConfig } from "rolldown"; +import { dts } from "rolldown-plugin-dts"; + +const production = !process.env.ROLLDOWN_WATCH; + +const bundles = [ + { input: "src/main.ts", outputDirectory: "dist/es", inlineWasm: true }, + { + input: "src/main-slim.ts", + outputDirectory: "dist/es-slim", + inlineWasm: false, + }, +]; + +export default defineConfig( + bundles.map(({ input, outputDirectory, inlineWasm }) => ({ + input, + output: { + dir: outputDirectory, + format: "es", + entryFileNames: "[name].js", + sourcemap: !production, + }, + plugins: [ + inlineWasm && wasm({ targetEnv: "auto-inline" }), + dts({ generator: "tsgo", tsconfig: "./tsconfig.build.json" }), + { + name: "check-public-imports", + generateBundle(_options, bundle) { + for (const chunk of Object.values(bundle)) { + if (chunk.type !== "chunk") { + continue; + } + + for (const importedModule of [ + ...chunk.imports, + ...chunk.dynamicImports, + ]) { + if (importedModule.startsWith("@local/")) { + this.error( + `${chunk.fileName} imports from unpublished package ${importedModule}`, + ); + } + } + } + }, + }, + { + name: "copy-wasm", + generateBundle() { + fs.mkdirSync(path.resolve("dist/wasm"), { recursive: true }); + fs.copyFileSync( + path.resolve("../rust/pkg/type-system_bg.wasm"), + path.resolve("dist/wasm/type-system.wasm"), + ); + fs.copyFileSync( + path.resolve("../rust/pkg/type-system_bg.wasm.d.ts"), + path.resolve("dist/wasm/type-system.wasm.d.ts"), + ); + }, + }, + ], + })), +); diff --git a/libs/@blockprotocol/type-system/typescript/rollup.config.js b/libs/@blockprotocol/type-system/typescript/rollup.config.js deleted file mode 100644 index 33913ec20fb..00000000000 --- a/libs/@blockprotocol/type-system/typescript/rollup.config.js +++ /dev/null @@ -1,85 +0,0 @@ -import fs from "node:fs"; -import path from "node:path"; - -import commonjs from "@rollup/plugin-commonjs"; -import nodeResolve from "@rollup/plugin-node-resolve"; -import typescript from "@rollup/plugin-typescript"; -import { wasm } from "@rollup/plugin-wasm"; - -const production = !process.env.ROLLUP_WATCH; - -const outdir = (fmt, env) => { - if (env === "node") { - return `dist/node`; - } else { - return `dist/${fmt}${env === "slim" ? "-slim" : ""}`; - } -}; - -const rolls = (fmt, env) => ({ - input: env !== "slim" ? "src/main.ts" : "src/main-slim.ts", - output: { - dir: outdir(fmt, env), - format: fmt, - entryFileNames: `[name].js`, - name: "type-system", - sourcemap: !production, - }, - plugins: [ - // We want to inline our wasm bundle as base64 on non-slim builds. - env !== "slim" ? wasm({ targetEnv: "auto-inline" }) : undefined, - typescript({ - declaration: true, - declarationDir: outdir(fmt, env), - outDir: outdir(fmt, env), - rootDir: "src", - sourceMap: !production, - inlineSources: !production, - outputToFilesystem: false, - }), - nodeResolve(), - commonjs(), - { - name: "copy-pkg", - resolveImportMeta: () => `""`, - generateBundle() { - fs.mkdirSync(path.resolve(`dist/wasm`), { recursive: true }); - - fs.copyFileSync( - path.resolve("../rust/pkg/type-system_bg.wasm"), - path.resolve("dist/wasm/type-system.wasm"), - ); - fs.copyFileSync( - path.resolve("../rust/pkg/type-system_bg.wasm.d.ts"), - path.resolve("dist/wasm/type-system.wasm.d.ts"), - ); - - // `src/generated` holds declaration files, which TypeScript passes over rather than - // emitting. Without this copy the re-exports in the emitted `main.d.ts` dangle. - const generatedDir = path.resolve(outdir(fmt, env), "generated"); - fs.mkdirSync(generatedDir, { recursive: true }); - - for (const file of fs.readdirSync(path.resolve("src/generated"))) { - // `Real` is the only type the generated declarations pull from another crate. Inlining - // it keeps the published package free of a dependency on the unpublished `hash-codec`. - const content = fs - .readFileSync(path.resolve("src/generated", file), "utf8") - .replace( - 'import type { Real } from "@local/hash-codec/types";', - "type Real = number;", - ); - - if (content.includes('from "@local/')) { - this.error( - `${file} imports from an unpublished \`@local/\` package`, - ); - } - - fs.writeFileSync(path.join(generatedDir, file), content); - } - }, - }, - ], -}); - -export default [rolls("es", "fat"), rolls("es", "slim")]; diff --git a/libs/@blockprotocol/type-system/typescript/src/native/entity.ts b/libs/@blockprotocol/type-system/typescript/src/native/entity.ts index 853f338dab1..46185751666 100644 --- a/libs/@blockprotocol/type-system/typescript/src/native/entity.ts +++ b/libs/@blockprotocol/type-system/typescript/src/native/entity.ts @@ -102,7 +102,7 @@ export const splitEntityId = ( return [webId as WebId, entityUuid as EntityUuid, draftId as DraftId]; }; -export const stripDraftIdFromEntityId = (entityId: EntityId) => { +export const stripDraftIdFromEntityId = (entityId: EntityId): EntityId => { const [webId, entityUuid] = splitEntityId(entityId); return entityIdFromComponents(webId, entityUuid); }; diff --git a/libs/@blockprotocol/type-system/typescript/tsconfig.build.json b/libs/@blockprotocol/type-system/typescript/tsconfig.build.json new file mode 100644 index 00000000000..9cc88c2872e --- /dev/null +++ b/libs/@blockprotocol/type-system/typescript/tsconfig.build.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "include": ["src"], + "compilerOptions": { + "rootDir": "src" + } +} diff --git a/libs/@blockprotocol/type-system/typescript/tsconfig.dist.json b/libs/@blockprotocol/type-system/typescript/tsconfig.dist.json new file mode 100644 index 00000000000..fb220548d8a --- /dev/null +++ b/libs/@blockprotocol/type-system/typescript/tsconfig.dist.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "include": ["dist/**/*.d.ts"], + "exclude": [], + "compilerOptions": { + "noEmit": true, + "skipLibCheck": false, + "types": [] + } +} diff --git a/yarn.lock b/yarn.lock index a593636ed7b..db6a15fabe2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -869,7 +869,7 @@ __metadata: react: "npm:19.2.6" react-dom: "npm:19.2.6" sharp: "npm:0.35.5" - typescript: "catalog:" + typescript: "catalog:typescript6" unist-util-visit: "npm:5.1.0" languageName: unknown linkType: soft @@ -957,6 +957,7 @@ __metadata: "@types/react-dom": "npm:19.2.3" "@types/webextension-polyfill": "npm:0.12.4" "@types/ws": "npm:8.18.1" + "@typescript/typescript6": "catalog:" babel-loader: "npm:10.0.0" babel-preset-react-app: "npm:10.1.0" bowser: "npm:2.12.1" @@ -976,14 +977,14 @@ __metadata: react: "npm:19.2.6" react-dom: "npm:19.2.6" react-refresh: "npm:0.18.0" - react-refresh-typescript: "npm:2.0.11" + react-refresh-typescript: "npm:2.0.12" rimraf: "npm:6.1.3" sass: "npm:1.93.2" sass-loader: "npm:13.3.3" source-map-loader: "npm:3.0.2" style-loader: "npm:3.3.4" terser-webpack-plugin: "npm:5.4.0" - ts-loader: "npm:9.5.4" + ts-loader: "npm:9.6.2" type-fest: "npm:5.3.1" typescript: "catalog:" uuid: "npm:14.0.0" @@ -4265,9 +4266,6 @@ __metadata: "@local/eslint": "workspace:*" "@local/hash-codec": "workspace:*" "@local/tsconfig": "workspace:*" - "@rollup/plugin-commonjs": "npm:29.0.0" - "@rollup/plugin-node-resolve": "npm:16.0.3" - "@rollup/plugin-typescript": "npm:12.3.0" "@rollup/plugin-wasm": "npm:6.2.2" "@tsconfig/bases": "catalog:" "@types/node": "catalog:" @@ -4277,7 +4275,8 @@ __metadata: eslint: "npm:9.39.4" react: "npm:19.2.6" rimraf: "npm:6.1.3" - rollup: "npm:4.59.0" + rolldown: "npm:1.2.6" + rolldown-plugin-dts: "npm:0.28.3" semver: "npm:7.7.3" tslib: "npm:2.8.1" typescript: "catalog:" @@ -14737,63 +14736,6 @@ __metadata: languageName: node linkType: hard -"@rollup/plugin-commonjs@npm:29.0.0": - version: 29.0.0 - resolution: "@rollup/plugin-commonjs@npm:29.0.0" - dependencies: - "@rollup/pluginutils": "npm:^5.0.1" - commondir: "npm:^1.0.1" - estree-walker: "npm:^2.0.2" - fdir: "npm:^6.2.0" - is-reference: "npm:1.2.1" - magic-string: "npm:^0.30.3" - picomatch: "npm:^4.0.2" - peerDependencies: - rollup: ^2.68.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - checksum: 10c0/e19f99aace255e625c3f92169108d444e522eb1119e26ec3af2e2744ec1d81d765ba1140e59afc9881a8640e0fcfe25a3b927d3c6877b850d57d6acddc1c5223 - languageName: node - linkType: hard - -"@rollup/plugin-node-resolve@npm:16.0.3": - version: 16.0.3 - resolution: "@rollup/plugin-node-resolve@npm:16.0.3" - dependencies: - "@rollup/pluginutils": "npm:^5.0.1" - "@types/resolve": "npm:1.20.2" - deepmerge: "npm:^4.2.2" - is-module: "npm:^1.0.0" - resolve: "npm:^1.22.1" - peerDependencies: - rollup: ^2.78.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - checksum: 10c0/5bafff8e51cd28b5b3b8f415c30a893f5bfdb1a54469e00b3dc6530f26051620f3dfa172f40544361948b46cc3070cb34fd44ade66d38c0677d74c846fbc58dc - languageName: node - linkType: hard - -"@rollup/plugin-typescript@npm:12.3.0": - version: 12.3.0 - resolution: "@rollup/plugin-typescript@npm:12.3.0" - dependencies: - "@rollup/pluginutils": "npm:^5.1.0" - resolve: "npm:^1.22.1" - peerDependencies: - rollup: ^2.14.0||^3.0.0||^4.0.0 - tslib: "*" - typescript: ">=3.7.0" - peerDependenciesMeta: - rollup: - optional: true - tslib: - optional: true - checksum: 10c0/41d14e9a9792d8d9751c275cf87c2de796ddd1a64c96fedc622baad8cfbb1247537e37ae428e59e1850de7d7165941ee1a4030dbe9bebd5fbb38c5e4f751d8b5 - languageName: node - linkType: hard - "@rollup/plugin-wasm@npm:6.2.2": version: 6.2.2 resolution: "@rollup/plugin-wasm@npm:6.2.2" @@ -14808,7 +14750,7 @@ __metadata: languageName: node linkType: hard -"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.0.2, @rollup/pluginutils@npm:^5.1.0, @rollup/pluginutils@npm:^5.3.0": +"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.0.2, @rollup/pluginutils@npm:^5.3.0": version: 5.3.0 resolution: "@rollup/pluginutils@npm:5.3.0" dependencies: @@ -14824,13 +14766,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.59.0" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@rollup/rollup-android-arm-eabi@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-android-arm-eabi@npm:4.60.4" @@ -14838,13 +14773,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-android-arm64@npm:4.59.0" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-android-arm64@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-android-arm64@npm:4.60.4" @@ -14852,13 +14780,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-darwin-arm64@npm:4.59.0" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-arm64@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-darwin-arm64@npm:4.60.4" @@ -14866,13 +14787,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-darwin-x64@npm:4.59.0" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-x64@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-darwin-x64@npm:4.60.4" @@ -14880,13 +14794,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.59.0" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-freebsd-arm64@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-freebsd-arm64@npm:4.60.4" @@ -14894,13 +14801,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-freebsd-x64@npm:4.59.0" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-freebsd-x64@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-freebsd-x64@npm:4.60.4" @@ -14908,13 +14808,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.59.0" - conditions: os=linux & cpu=arm & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-gnueabihf@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.60.4" @@ -14922,13 +14815,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.59.0" - conditions: os=linux & cpu=arm & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-musleabihf@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.60.4" @@ -14936,13 +14822,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.59.0" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-gnu@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.60.4" @@ -14950,13 +14829,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.59.0" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-musl@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-arm64-musl@npm:4.60.4" @@ -14964,13 +14836,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-loong64-gnu@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.59.0" - conditions: os=linux & cpu=loong64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-loong64-gnu@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.60.4" @@ -14978,13 +14843,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-loong64-musl@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-loong64-musl@npm:4.59.0" - conditions: os=linux & cpu=loong64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-loong64-musl@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-loong64-musl@npm:4.60.4" @@ -14992,13 +14850,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-ppc64-gnu@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.59.0" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-ppc64-gnu@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.60.4" @@ -15006,13 +14857,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-ppc64-musl@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-ppc64-musl@npm:4.59.0" - conditions: os=linux & cpu=ppc64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-ppc64-musl@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-ppc64-musl@npm:4.60.4" @@ -15020,13 +14864,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.59.0" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-riscv64-gnu@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.60.4" @@ -15034,13 +14871,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-musl@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.59.0" - conditions: os=linux & cpu=riscv64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-riscv64-musl@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.60.4" @@ -15048,13 +14878,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.59.0" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-s390x-gnu@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.60.4" @@ -15062,13 +14885,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.59.0" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-gnu@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-x64-gnu@npm:4.60.4" @@ -15076,13 +14892,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.59.0" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-musl@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-linux-x64-musl@npm:4.60.4" @@ -15090,13 +14899,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-openbsd-x64@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-openbsd-x64@npm:4.59.0" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-openbsd-x64@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-openbsd-x64@npm:4.60.4" @@ -15104,13 +14906,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-openharmony-arm64@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-openharmony-arm64@npm:4.59.0" - conditions: os=openharmony & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-openharmony-arm64@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-openharmony-arm64@npm:4.60.4" @@ -15118,13 +14913,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.59.0" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-win32-arm64-msvc@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.60.4" @@ -15132,13 +14920,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.59.0" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@rollup/rollup-win32-ia32-msvc@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.60.4" @@ -15146,13 +14927,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-x64-gnu@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-win32-x64-gnu@npm:4.59.0" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-win32-x64-gnu@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-win32-x64-gnu@npm:4.60.4" @@ -15160,13 +14934,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.59.0": - version: 4.59.0 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.59.0" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-win32-x64-msvc@npm:4.60.4": version: 4.60.4 resolution: "@rollup/rollup-win32-x64-msvc@npm:4.60.4" @@ -19101,13 +18868,6 @@ __metadata: languageName: node linkType: hard -"@types/resolve@npm:1.20.2": - version: 1.20.2 - resolution: "@types/resolve@npm:1.20.2" - checksum: 10c0/c5b7e1770feb5ccfb6802f6ad82a7b0d50874c99331e0c9b259e415e55a38d7a86ad0901c57665d93f75938be2a6a0bc9aa06c9749192cadb2e4512800bbc6e6 - languageName: node - linkType: hard - "@types/resolve@npm:^1.20.2": version: 1.20.6 resolution: "@types/resolve@npm:1.20.6" @@ -25858,7 +25618,7 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:5.24.1, enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.15.0, enhanced-resolve@npm:^5.17.4, enhanced-resolve@npm:^5.22.0, enhanced-resolve@npm:^5.7.0": +"enhanced-resolve@npm:5.24.1, enhanced-resolve@npm:^5.15.0, enhanced-resolve@npm:^5.17.4, enhanced-resolve@npm:^5.22.0, enhanced-resolve@npm:^5.7.0": version: 5.24.1 resolution: "enhanced-resolve@npm:5.24.1" dependencies: @@ -31079,13 +30839,6 @@ __metadata: languageName: node linkType: hard -"is-module@npm:^1.0.0": - version: 1.0.0 - resolution: "is-module@npm:1.0.0" - checksum: 10c0/795a3914bcae7c26a1c23a1e5574c42eac13429625045737bf3e324ce865c0601d61aee7a5afbca1bee8cb300c7d9647e7dc98860c9bdbc3b7fdc51d8ac0bffc - languageName: node - linkType: hard - "is-negative-zero@npm:^2.0.3": version: 2.0.3 resolution: "is-negative-zero@npm:2.0.3" @@ -34188,7 +33941,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.0, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5, micromatch@npm:^4.0.8": +"micromatch@npm:^4.0.4, micromatch@npm:^4.0.5, micromatch@npm:^4.0.8": version: 4.0.8 resolution: "micromatch@npm:4.0.8" dependencies: @@ -36867,7 +36620,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^4.0.2, picomatch@npm:^4.0.3, picomatch@npm:^4.0.4, picomatch@npm:^4.0.7": +"picomatch@npm:^4.0.0, picomatch@npm:^4.0.2, picomatch@npm:^4.0.3, picomatch@npm:^4.0.4, picomatch@npm:^4.0.7": version: 4.0.7 resolution: "picomatch@npm:4.0.7" checksum: 10c0/beb6ae02c43ae44e84883b90830196d9046b1726ead292adcf7f57945e0bb0d992d68563d87e03b484b6f3c9a5c6defda7523477f047d7f0e663f126cc01787f @@ -38218,13 +37971,13 @@ __metadata: languageName: node linkType: hard -"react-refresh-typescript@npm:2.0.11": - version: 2.0.11 - resolution: "react-refresh-typescript@npm:2.0.11" +"react-refresh-typescript@npm:2.0.12": + version: 2.0.12 + resolution: "react-refresh-typescript@npm:2.0.12" peerDependencies: react-refresh: 0.10.x || 0.11.x || 0.12.x || 0.13.x || 0.14.x || 0.15.x || 0.16.x || 0.17.x || 0.18.x || 0.19.x - typescript: ^4.8 || ^5.0 - checksum: 10c0/bf8448cfa92da611a5ca6777a1f7a56904a0cdd0d67a69708c65c3c8b6a4a9841f3494f1914a0ce1d308c338e294a20532ea607ebc712f7c400a566a403f58bf + typescript: ^4.8 || ^5.0 || ^6.0 + checksum: 10c0/2fc07a625f70f0907811c5e419ca61fc21b4f81e752618c5a9cf937636e7645dfa5f4b1c768d7570c14a7b5d9e2d4ad33ace0b503914cbde31d8e227cda490ce languageName: node linkType: hard @@ -39500,96 +39253,6 @@ __metadata: languageName: node linkType: hard -"rollup@npm:4.59.0": - version: 4.59.0 - resolution: "rollup@npm:4.59.0" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.59.0" - "@rollup/rollup-android-arm64": "npm:4.59.0" - "@rollup/rollup-darwin-arm64": "npm:4.59.0" - "@rollup/rollup-darwin-x64": "npm:4.59.0" - "@rollup/rollup-freebsd-arm64": "npm:4.59.0" - "@rollup/rollup-freebsd-x64": "npm:4.59.0" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.59.0" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.59.0" - "@rollup/rollup-linux-arm64-gnu": "npm:4.59.0" - "@rollup/rollup-linux-arm64-musl": "npm:4.59.0" - "@rollup/rollup-linux-loong64-gnu": "npm:4.59.0" - "@rollup/rollup-linux-loong64-musl": "npm:4.59.0" - "@rollup/rollup-linux-ppc64-gnu": "npm:4.59.0" - "@rollup/rollup-linux-ppc64-musl": "npm:4.59.0" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.59.0" - "@rollup/rollup-linux-riscv64-musl": "npm:4.59.0" - "@rollup/rollup-linux-s390x-gnu": "npm:4.59.0" - "@rollup/rollup-linux-x64-gnu": "npm:4.59.0" - "@rollup/rollup-linux-x64-musl": "npm:4.59.0" - "@rollup/rollup-openbsd-x64": "npm:4.59.0" - "@rollup/rollup-openharmony-arm64": "npm:4.59.0" - "@rollup/rollup-win32-arm64-msvc": "npm:4.59.0" - "@rollup/rollup-win32-ia32-msvc": "npm:4.59.0" - "@rollup/rollup-win32-x64-gnu": "npm:4.59.0" - "@rollup/rollup-win32-x64-msvc": "npm:4.59.0" - "@types/estree": "npm:1.0.8" - fsevents: "npm:~2.3.2" - dependenciesMeta: - "@rollup/rollup-android-arm-eabi": - optional: true - "@rollup/rollup-android-arm64": - optional: true - "@rollup/rollup-darwin-arm64": - optional: true - "@rollup/rollup-darwin-x64": - optional: true - "@rollup/rollup-freebsd-arm64": - optional: true - "@rollup/rollup-freebsd-x64": - optional: true - "@rollup/rollup-linux-arm-gnueabihf": - optional: true - "@rollup/rollup-linux-arm-musleabihf": - optional: true - "@rollup/rollup-linux-arm64-gnu": - optional: true - "@rollup/rollup-linux-arm64-musl": - optional: true - "@rollup/rollup-linux-loong64-gnu": - optional: true - "@rollup/rollup-linux-loong64-musl": - optional: true - "@rollup/rollup-linux-ppc64-gnu": - optional: true - "@rollup/rollup-linux-ppc64-musl": - optional: true - "@rollup/rollup-linux-riscv64-gnu": - optional: true - "@rollup/rollup-linux-riscv64-musl": - optional: true - "@rollup/rollup-linux-s390x-gnu": - optional: true - "@rollup/rollup-linux-x64-gnu": - optional: true - "@rollup/rollup-linux-x64-musl": - optional: true - "@rollup/rollup-openbsd-x64": - optional: true - "@rollup/rollup-openharmony-arm64": - optional: true - "@rollup/rollup-win32-arm64-msvc": - optional: true - "@rollup/rollup-win32-ia32-msvc": - optional: true - "@rollup/rollup-win32-x64-gnu": - optional: true - "@rollup/rollup-win32-x64-msvc": - optional: true - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 10c0/f38742da34cfee5e899302615fa157aa77cb6a2a1495e5e3ce4cc9c540d3262e235bbe60caa31562bbfe492b01fdb3e7a8c43c39d842d3293bcf843123b766fc - languageName: node - linkType: hard - "rollup@npm:^4.34.8, rollup@npm:^4.60.3": version: 4.60.4 resolution: "rollup@npm:4.60.4" @@ -40044,7 +39707,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.8.5, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.8, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.1, semver@npm:^7.6.2, semver@npm:^7.6.3, semver@npm:^7.7.1, semver@npm:^7.7.3, semver@npm:^7.8.1, semver@npm:^7.8.5": +"semver@npm:7.8.5, semver@npm:^7.3.5, semver@npm:^7.3.8, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.1, semver@npm:^7.6.2, semver@npm:^7.6.3, semver@npm:^7.7.1, semver@npm:^7.7.3, semver@npm:^7.8.1, semver@npm:^7.8.5": version: 7.8.5 resolution: "semver@npm:7.8.5" bin: @@ -42151,19 +41814,21 @@ __metadata: languageName: node linkType: hard -"ts-loader@npm:9.5.4": - version: 9.5.4 - resolution: "ts-loader@npm:9.5.4" +"ts-loader@npm:9.6.2": + version: 9.6.2 + resolution: "ts-loader@npm:9.6.2" dependencies: chalk: "npm:^4.1.0" - enhanced-resolve: "npm:^5.0.0" - micromatch: "npm:^4.0.0" - semver: "npm:^7.3.4" + picomatch: "npm:^4.0.0" source-map: "npm:^0.7.4" peerDependencies: + loader-utils: "*" typescript: "*" - webpack: ^5.0.0 - checksum: 10c0/f0982404b43628c335d3b3a60ac3f1738385da7b97c3f04cb5ad2ebad791597be39b25c8a4e158a66173f9bd9f5aa72e285b046b0573e4beed8ecd032d418e4d + webpack: ^4.0.0 || ^5.0.0 + peerDependenciesMeta: + loader-utils: + optional: true + checksum: 10c0/6102336ee598124249e07cce6bb3d4ee0586f962697b7388d1957296a2c7d5164b95757797db237bdb7b8f0c5a52d2f22ca5013d3337823d8e9e0e731ce03c67 languageName: node linkType: hard From 370da844e1ad2ef0950f360db12b386a04c3b9b8 Mon Sep 17 00:00:00 2001 From: Bilal Mahmoud <7252775+indietyp@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:59:07 +0200 Subject: [PATCH 04/13] chore: clarify url validation and test types --- .../type-system/typescript/src/native/url.ts | 3 +- .../type-system/typescript/test/url.test.ts | 31 +++++++------------ 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/libs/@blockprotocol/type-system/typescript/src/native/url.ts b/libs/@blockprotocol/type-system/typescript/src/native/url.ts index 7b0b1f86639..85f36fa1d9e 100644 --- a/libs/@blockprotocol/type-system/typescript/src/native/url.ts +++ b/libs/@blockprotocol/type-system/typescript/src/native/url.ts @@ -29,7 +29,8 @@ export const validateBaseUrl = ( }; } try { - void new URL(url); + // eslint-disable-next-line no-new -- The constructor validates by throwing; its result is unused. + new URL(url); if (url.endsWith("/")) { return { type: "Ok", diff --git a/libs/@blockprotocol/type-system/typescript/test/url.test.ts b/libs/@blockprotocol/type-system/typescript/test/url.test.ts index 4594a64d5dd..61555805203 100644 --- a/libs/@blockprotocol/type-system/typescript/test/url.test.ts +++ b/libs/@blockprotocol/type-system/typescript/test/url.test.ts @@ -115,19 +115,16 @@ describe("makeOntologyTypeVersion", () => { }); const extractBaseUrlCases: [VersionedUrl, BaseUrl][] = [ - ["http://example.com/v/1" as VersionedUrl, "http://example.com/" as BaseUrl], + ["http://example.com/v/1", "http://example.com/" as BaseUrl], [ - "http://example.com/sandwich/v/1" as VersionedUrl, + "http://example.com/sandwich/v/1", "http://example.com/sandwich/" as BaseUrl, ], [ - "file://localhost/documents/myfolder/v/10" as VersionedUrl, + "file://localhost/documents/myfolder/v/10", "file://localhost/documents/myfolder/" as BaseUrl, ], - [ - "ftp://rms@example.com/foo/v/5" as VersionedUrl, - "ftp://rms@example.com/foo/" as BaseUrl, - ], + ["ftp://rms@example.com/foo/v/5", "ftp://rms@example.com/foo/" as BaseUrl], ]; describe("extractBaseUrl", () => { @@ -140,10 +137,10 @@ describe("extractBaseUrl", () => { }); const extractVersionCases: [VersionedUrl, string][] = [ - ["http://example.com/v/1" as VersionedUrl, "1"], - ["http://example.com/sandwich/v/1" as VersionedUrl, "1"], - ["file://localhost/documents/myfolder/v/10" as VersionedUrl, "10"], - ["ftp://rms@example.com/foo/v/5" as VersionedUrl, "5"], + ["http://example.com/v/1", "1"], + ["http://example.com/sandwich/v/1", "1"], + ["file://localhost/documents/myfolder/v/10", "10"], + ["ftp://rms@example.com/foo/v/5", "5"], ]; describe("extractVersion", () => { @@ -194,15 +191,9 @@ describe("Draft version support", () => { }); describe("extractVersion with drafts", () => { - test.each([ - [ - "http://example.com/v/1-draft.abc12345.1" as VersionedUrl, - "1-draft.abc12345.1", - ], - [ - "http://example.com/v/2-draft.xyz98765.999" as VersionedUrl, - "2-draft.xyz98765.999", - ], + test.each<[VersionedUrl, string]>([ + ["http://example.com/v/1-draft.abc12345.1", "1-draft.abc12345.1"], + ["http://example.com/v/2-draft.xyz98765.999", "2-draft.xyz98765.999"], ])("extractVersion(%s) returns draft version", (input, expected) => { expect(extractVersion(input).toString()).toEqual(expected); }); From de9e68a65887ceff6911a146606455928b77c4d5 Mon Sep 17 00:00:00 2001 From: Bilal Mahmoud <7252775+indietyp@users.noreply.github.com> Date: Tue, 6 Oct 2026 23:38:47 +0200 Subject: [PATCH 05/13] refactor: externalize TypeScript compiler dependency --- libs/@hashintel/petrinaut-core/vite.config.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libs/@hashintel/petrinaut-core/vite.config.ts b/libs/@hashintel/petrinaut-core/vite.config.ts index 394572b0d42..bac1564265d 100644 --- a/libs/@hashintel/petrinaut-core/vite.config.ts +++ b/libs/@hashintel/petrinaut-core/vite.config.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url"; import ts from "@typescript/typescript6"; import { dts } from "rolldown-plugin-dts"; -import { esmExternalRequirePlugin, replacePlugin } from "rolldown/plugins"; +import { replacePlugin } from "rolldown/plugins"; import { defineConfig } from "vite"; const packageRoot = dirname(fileURLToPath(import.meta.url)); @@ -100,14 +100,7 @@ export default defineConfig(({ command }) => ({ ], }, - plugins: [ - esmExternalRequirePlugin({ - // Peer (optional): only the ./hir compiler entry needs it. - external: ["@typescript/typescript6"], - }), - - command === "build" && dts({ generator: "tsgo" }), - ], + plugins: [command === "build" && dts({ generator: "tsgo" })], experimental: { // A worker URL resolved against the importing module survives bundling by From b974efd514cce31112bb01f858142082b11e3f27 Mon Sep 17 00:00:00 2001 From: Bilal Mahmoud <7252775+indietyp@users.noreply.github.com> Date: Wed, 7 Oct 2026 08:48:47 +0200 Subject: [PATCH 06/13] chore: prepare TypeScript 7 compatibility --- .yarnrc.yml | 4 +++ .../generate-chart-config-action.ts | 7 ++--- .../generate-structural-query-action.ts | 4 +-- .../convert-subgraph-to-sheet-requests.ts | 2 +- .../get-llm-response/get-openai-reponse.ts | 2 +- .../shared/get-llm-response/llm-message.ts | 2 +- .../src/analysis/analyses/dashboards.test.ts | 4 +-- .../resolve-analysis.test.ts | 4 +-- .../auth/kratos-endpoint-allowlist.test.ts | 4 +-- ...user-before-update-entity-hook-callback.ts | 2 +- .../graph/knowledge/system-types/comment.ts | 2 +- .../knowledge/system-types/user-secret.ts | 4 +-- .../user/submit-early-access-form.ts | 2 +- .../graphql/resolvers/ontology/entity-type.ts | 2 +- .../resolvers/ontology/property-type.ts | 2 +- .../src/integrations/google/oauth-callback.ts | 2 +- .../hash-api/src/integrations/linear/oauth.ts | 2 +- apps/hash-frontend/eslint.config.js | 3 +- apps/hash-frontend/package.json | 1 - .../shared/split-properties-and-metadata.ts | 8 ++--- .../src/stdlib/subgraph/edge/entity-type.ts | 1 + .../src/stdlib/subgraph/edge/link-entity.ts | 10 +++---- .../graph/src/stdlib/subgraph/edge/shared.ts | 1 + .../graph/src/stdlib/subgraph/roots.ts | 2 +- .../graph/src/util/typed-entries.ts | 2 +- .../design-system/src/data-type-selector.tsx | 2 +- libs/@hashintel/design-system/src/theme.ts | 2 +- .../@hashintel/ds-components/eslint.config.js | 4 +-- .../filter-row/property-type-selector.tsx | 1 + .../advanced-types/src/typed-entries.ts | 2 +- libs/@local/eslint/package.json | 5 ++++ libs/@local/eslint/src/plugins.ts | 3 ++ .../graph/sdk/typescript/src/entity-type.ts | 12 +++----- .../@local/graph/sdk/typescript/src/entity.ts | 23 ++++++--------- .../graph/sdk/typescript/src/subgraph.ts | 2 +- .../typescript/src/binary/MutableBytes.ts | 4 +-- .../typescript/src/codec/JsonEncoder.ts | 2 +- .../harpc/client/typescript/src/net/Client.ts | 2 +- .../client/typescript/src/net/Connection.ts | 2 +- .../client/typescript/src/net/Request.ts | 2 +- .../client/typescript/src/net/Transaction.ts | 3 +- .../client/typescript/src/net/internal/dns.ts | 26 ++++++++--------- .../src/wire-protocol/RequestIdProducer.ts | 2 +- .../tests/codec/JsonDecoder.test.ts | 2 +- .../src/create-graph-client.ts | 2 +- libs/@local/hash-backend-utils/src/logger.ts | 4 +-- .../hash-backend-utils/src/notifications.ts | 4 +-- .../src/opentelemetry.test.ts | 3 +- .../hash-isomorphic-utils/src/blocks.ts | 2 +- .../src/create-apollo-client.ts | 1 + .../src/production-schedule/validation.ts | 2 +- .../src/service-usage.ts | 6 ++-- package.json | 1 + .../graph/knowledge/primitive/entity.test.ts | 20 ++++++------- .../knowledge/primitive/link-entity.test.ts | 16 +++++----- .../knowledge/system-types/block.test.ts | 8 ++--- .../knowledge/system-types/comment.test.ts | 8 ++--- .../system-types/mention-notification.test.ts | 8 ++--- .../org-invitation-email-casing.test.ts | 2 +- .../graph/knowledge/system-types/page.test.ts | 14 ++++----- .../graph/knowledge/system-types/user.test.ts | 2 +- .../ontology/primitive/entity-type.test.ts | 29 +++++++++---------- .../src/tests/subgraph/circular.test.ts | 1 + .../src/tests/subgraph/friendship.test.ts | 4 +++ yarn.lock | 3 +- 65 files changed, 159 insertions(+), 161 deletions(-) create mode 100644 libs/@local/eslint/src/plugins.ts diff --git a/.yarnrc.yml b/.yarnrc.yml index 725b01da27d..8847b94fa47 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -35,6 +35,10 @@ packageExtensions: "@astrojs/language-server@2.16.13": peerDependencies: typescript: "^5.0.0 || ^6.0.0" + # Dependency analysis and its public types require the JavaScript compiler API. + "dependency-cruiser@18.0.0": + dependencies: + typescript: "6.0.3" # Native tool input public declarations in the pinned local runtime patch. # Patch manifest edits alone do not add dependencies during Yarn resolution. "@flue/runtime@2.3.0": diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-chart-config-action.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-chart-config-action.ts index 3a581121ec1..98c36b5129b 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-chart-config-action.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-chart-config-action.ts @@ -94,10 +94,7 @@ const tools: LlmToolDefinition[] = [ * string rather than an object — parse it before schema validation. */ sanitizeInputBeforeValidation: (rawInput) => { - if ( - "config" in rawInput && - typeof (rawInput as { config: unknown }).config === "string" - ) { + if ("config" in rawInput && typeof rawInput.config === "string") { return { ...rawInput, config: JSON.parse( @@ -332,7 +329,7 @@ export const generateChartConfigAction: FlowActionActivity< Array.isArray(parsedChartData) && parsedChartData.length > 0 && parsedChartData[0] - ? Object.keys(parsedChartData[0] as object).join(", ") + ? Object.keys(parsedChartData[0]).join(", ") : "unknown" } diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-structural-query-action.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-structural-query-action.ts index 863edf4dccf..a3549a43539 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-structural-query-action.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/generate-structural-query-action.ts @@ -560,7 +560,7 @@ const tools: LlmToolDefinition[] = [ }, required: ["filter"], additionalProperties: false, - $defs: filterSchemaDefinitions as Record, + $defs: filterSchemaDefinitions, }, }, { @@ -598,7 +598,7 @@ const tools: LlmToolDefinition[] = [ }, required: ["filter", "explanation", "suggestedChartTypes"], additionalProperties: false, - $defs: filterSchemaDefinitions as Record, + $defs: filterSchemaDefinitions, }, }, ]; diff --git a/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/convert-subgraph-to-sheet-requests.ts b/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/convert-subgraph-to-sheet-requests.ts index 2645510d12c..d5af548fe51 100644 --- a/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/convert-subgraph-to-sheet-requests.ts +++ b/apps/hash-ai-worker-ts/src/activities/flow-activities/write-google-sheet-action/convert-subgraph-to-sheet-requests.ts @@ -106,7 +106,7 @@ const createColumnsForEntity = ( for (const { schema } of entityTypeAndParents) { for (const baseUrl of typedKeys(schema.properties)) { - properties.add(baseUrl as BaseUrl); + properties.add(baseUrl); } for (const linkTypeId of typedKeys(schema.links ?? {})) { links.add(linkTypeId); diff --git a/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response/get-openai-reponse.ts b/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response/get-openai-reponse.ts index 0ed07a37879..45641613bb1 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response/get-openai-reponse.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response/get-openai-reponse.ts @@ -55,7 +55,7 @@ const mapLlmToolDefinitionToOpenAiToolDefinition = ( */ strict: false, name: tool.name, - parameters: tool.inputSchema as OpenAI.FunctionParameters, + parameters: tool.inputSchema, description: tool.description, }, }); diff --git a/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response/llm-message.ts b/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response/llm-message.ts index 4e6cc31722b..949d88dd7b6 100644 --- a/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response/llm-message.ts +++ b/apps/hash-ai-worker-ts/src/activities/shared/get-llm-response/llm-message.ts @@ -395,7 +395,7 @@ export const mapOpenAiMessagesToLlmMessages = (params: { { role: "user", content: [toolResultContent], - } as LlmUserMessage, + }, ]; } diff --git a/apps/hash-api/src/analysis/analyses/dashboards.test.ts b/apps/hash-api/src/analysis/analyses/dashboards.test.ts index 8dc5c6ed49a..d655d210d9a 100644 --- a/apps/hash-api/src/analysis/analyses/dashboards.test.ts +++ b/apps/hash-api/src/analysis/analyses/dashboards.test.ts @@ -177,7 +177,7 @@ describe("dashboardItemData analysis", () => { registerAnalyses(dashboardAnalyses); mockedGetRole.mockReset(); - mockedGetRole.mockResolvedValue("member" as RoleName); + mockedGetRole.mockResolvedValue("member"); mockedGetWebMachineId.mockReset(); mockedGetWebMachineId.mockResolvedValue(WEB_MACHINE_ID); @@ -209,7 +209,7 @@ describe("dashboardItemData analysis", () => { it("errors when the item does not exist in the web", async () => { mockedQueryEntities.mockResolvedValue({ entities: [], - } as unknown as Awaited>); + }); const result = await resolve({ itemUuid: ITEM_UUID }); expect(result.status).toBe("error"); diff --git a/apps/hash-api/src/analysis/setup-analysis-handler/resolve-analysis.test.ts b/apps/hash-api/src/analysis/setup-analysis-handler/resolve-analysis.test.ts index f8c4c59f101..cc25f5211a8 100644 --- a/apps/hash-api/src/analysis/setup-analysis-handler/resolve-analysis.test.ts +++ b/apps/hash-api/src/analysis/setup-analysis-handler/resolve-analysis.test.ts @@ -89,7 +89,7 @@ describe("resolveInvocation (supply-chain analyses)", () => { clearAnalysisRegistry(); registerAnalyses(supplyChainAnalyses); mockedGetRole.mockReset(); - mockedGetRole.mockResolvedValue("member" as RoleName); + mockedGetRole.mockResolvedValue("member"); }); it("resolves productGraph to a presigned graph artifact", async () => { @@ -387,7 +387,7 @@ describe("resolveInvocation (supply-chain analyses)", () => { getObjectLastModified: async () => { throw new Error("Storage unavailable"); }, - } as unknown as FileStorageProvider, + }, cache, }); diff --git a/apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts b/apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts index ba34158d150..d489f1ba2c8 100644 --- a/apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts +++ b/apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts @@ -325,7 +325,7 @@ describe("guardKratosProxy", () => { const guarded = guardKratosProxy({ logger: { error } as unknown as Logger, - proxy: proxy as unknown as RequestHandler, + proxy, }); const call = ( @@ -341,7 +341,7 @@ describe("guardKratosProxy", () => { ip, } as unknown as Request, { sendStatus } as unknown as Response, - next as unknown as NextFunction, + next, ); }; diff --git a/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts b/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts index 4a0df76019c..0ead5948bef 100644 --- a/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts +++ b/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts @@ -255,7 +255,7 @@ export const userBeforeEntityUpdateHookCallback: BeforeUpdateEntityHookCallback await updateWebShortname( context.graphApi, { actorId: systemAccountId }, - { webId: user.accountId as WebId, shortname: updatedShortname }, + { webId: user.accountId, shortname: updatedShortname }, ); } }; diff --git a/apps/hash-api/src/graph/knowledge/system-types/comment.ts b/apps/hash-api/src/graph/knowledge/system-types/comment.ts index c1cfcc97464..52c2a4eb94a 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/comment.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/comment.ts @@ -453,7 +453,7 @@ export const getCommentAncestorBlock: ImpureGraphFunction< ) ) { // @todo - make sure the entity is really a block - return getBlockFromEntity({ entity: parentEntity as Block["entity"] }); + return getBlockFromEntity({ entity: parentEntity }); } else { return getCommentAncestorBlock(context, authentication, { commentEntityId: parentEntity.metadata.recordId.entityId, diff --git a/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts b/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts index 2b8928b9b3e..da3ee5d2c19 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts @@ -165,7 +165,7 @@ export const createUserSecret = async < authentication, { entityTypeIds: [systemEntityTypes.userSecret.entityTypeId], - webId: userAccountId as WebId, + webId: userAccountId, entityUuid: userSecretEntityUuid, properties: secretMetadata, policies: [ @@ -188,7 +188,7 @@ export const createUserSecret = async < { graphApi, provenance }, authentication, { - webId: userAccountId as WebId, + webId: userAccountId, entityUuid: usesUserSecretEntityUuid, properties: { value: {} }, linkData: { diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts b/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts index 872bf36c243..0bf6d99520e 100644 --- a/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts +++ b/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts @@ -31,7 +31,7 @@ export const submitEarlyAccessFormResolver: ResolverFn< /** The user does not yet have permissions to create entities, so we do it with the HASH system account instead */ authentication, { - webId: user.accountId as WebId, + webId: user.accountId, entityTypeIds: [systemEntityTypes.prospectiveUser.entityTypeId], properties: { value: { diff --git a/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts b/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts index aa7e7794241..6df879592cc 100644 --- a/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts +++ b/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts @@ -58,7 +58,7 @@ export const createEntityTypeResolver: ResolverFn< const { webId, entityType } = params; const createdEntityType = await createEntityType(context, authentication, { - webId: webId ?? (user.accountId as WebId), + webId: webId ?? user.accountId, schema: entityType, }); diff --git a/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts b/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts index 0f52e150014..ad6c398a45e 100644 --- a/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts +++ b/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts @@ -46,7 +46,7 @@ export const createPropertyTypeResolver: ResolverFn< context, authentication, { - webId: (webId ?? user.accountId) as WebId, + webId: webId ?? user.accountId, schema: propertyType, }, ); diff --git a/apps/hash-api/src/integrations/google/oauth-callback.ts b/apps/hash-api/src/integrations/google/oauth-callback.ts index 9310243169d..413025ac636 100644 --- a/apps/hash-api/src/integrations/google/oauth-callback.ts +++ b/apps/hash-api/src/integrations/google/oauth-callback.ts @@ -125,7 +125,7 @@ export const googleOAuthCallback: RequestHandler< newGoogleAccountEntity = await createEntity(req.context, authentication, { entityTypeIds: [googleEntityTypes.account.entityTypeId], - webId: req.user.accountId as WebId, + webId: req.user.accountId, properties: googleAccountProperties, }); } diff --git a/apps/hash-api/src/integrations/linear/oauth.ts b/apps/hash-api/src/integrations/linear/oauth.ts index 084fbe86f57..2842cf38901 100644 --- a/apps/hash-api/src/integrations/linear/oauth.ts +++ b/apps/hash-api/src/integrations/linear/oauth.ts @@ -246,7 +246,7 @@ export const oAuthLinearCallback: RequestHandler< authentication, { entityTypeIds: [systemEntityTypes.linearIntegration.entityTypeId], - webId: userAccountId as WebId, + webId: userAccountId, entityUuid, properties: linearIntegrationProperties, }, diff --git a/apps/hash-frontend/eslint.config.js b/apps/hash-frontend/eslint.config.js index 90422942cd5..7e3b5ed6d46 100644 --- a/apps/hash-frontend/eslint.config.js +++ b/apps/hash-frontend/eslint.config.js @@ -1,10 +1,9 @@ -import reactX from "eslint-plugin-react-x"; - import { defineConfig, createBase, disableRules, } from "@local/eslint/deprecated"; +import { reactX } from "@local/eslint/plugins"; export default [ ...createBase(import.meta.dirname), diff --git a/apps/hash-frontend/package.json b/apps/hash-frontend/package.json index c9ed27c90ff..2a4b932b714 100644 --- a/apps/hash-frontend/package.json +++ b/apps/hash-frontend/package.json @@ -188,7 +188,6 @@ "@types/url-regex-safe": "1.0.2", "@welldone-software/why-did-you-render": "10.0.1", "eslint": "9.39.4", - "eslint-plugin-react-x": "1.17.2", "graphology-types": "0.24.8", "jsdom": "24.1.3", "rimraf": "6.1.3", diff --git a/apps/hash-integration-worker/src/activities/flow-activities/shared/split-properties-and-metadata.ts b/apps/hash-integration-worker/src/activities/flow-activities/shared/split-properties-and-metadata.ts index 0cb10fc58a0..15712ec6bf8 100644 --- a/apps/hash-integration-worker/src/activities/flow-activities/shared/split-properties-and-metadata.ts +++ b/apps/hash-integration-worker/src/activities/flow-activities/shared/split-properties-and-metadata.ts @@ -34,7 +34,7 @@ const extractPropertyValue = ( if (Array.isArray(propertyWithMetadata.value)) { return propertyWithMetadata.value.map((element) => extractPropertyValue(element as PropertyWithMetadata), - ) as PropertyValue; + ); } // Check if it's an object (PropertyObjectWithMetadata) @@ -50,7 +50,7 @@ const extractPropertyValue = ( key, extractPropertyValue(value as PropertyWithMetadata), ]), - ) as PropertyValue; + ); } } @@ -74,7 +74,7 @@ const extractPropertyMetadata = ( // This is a PropertyValueWithMetadata return { metadata: propertyWithMetadata.metadata, - } as PropertyValueMetadata; + }; } // Check if it's an array @@ -127,7 +127,7 @@ const extractPropertyMetadata = ( // Fallback: return value metadata with null dataTypeId return { metadata: { dataTypeId: null }, - } as PropertyValueMetadata; + }; }; /** diff --git a/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/entity-type.ts b/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/entity-type.ts index ce79a993a2b..d2b034e6f70 100644 --- a/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/entity-type.ts +++ b/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/entity-type.ts @@ -66,6 +66,7 @@ export const getEntityTypesReferencedByEntityType = ( revisionId = entityTypeId.revisionId; } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type const outwardEdges = (subgraph.edges as OntologyRootedEdges)[baseUrl]?.[ revisionId ]; diff --git a/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/link-entity.ts b/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/link-entity.ts index e442790124f..d0425462c78 100644 --- a/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/link-entity.ts +++ b/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/link-entity.ts @@ -63,6 +63,7 @@ export const getOutgoingLinksForEntity = ( const searchInterval = interval ?? getLatestInstantIntervalForSubgraph(subgraph); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type const entityEdges = (subgraph.edges as KnowledgeGraphRootedEdges)[entityId]; if (!entityEdges) { @@ -135,6 +136,7 @@ export const getIncomingLinksForEntity = ( const searchInterval = interval ?? getLatestInstantIntervalForSubgraph(subgraph); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type const entityEdges = (subgraph.edges as KnowledgeGraphRootedEdges)[entityId]; if (!entityEdges) { @@ -206,9 +208,7 @@ export const getLeftEntityForLinkEntity = ( const searchInterval = interval ?? getLatestInstantIntervalForSubgraph(subgraph); - const outwardEdge = Object.values( - (subgraph.edges as KnowledgeGraphRootedEdges)[entityId] ?? {}, - ) + const outwardEdge = Object.values(subgraph.edges[entityId] ?? {}) .flat() .find(isHasLeftEntityEdge); @@ -257,9 +257,7 @@ export const getRightEntityForLinkEntity = ( const searchInterval = interval ?? getLatestInstantIntervalForSubgraph(subgraph); - const outwardEdge = Object.values( - (subgraph.edges as KnowledgeGraphRootedEdges)[entityId] ?? {}, - ) + const outwardEdge = Object.values(subgraph.edges[entityId] ?? {}) .flat() .find(isHasRightEntityEdge); diff --git a/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/shared.ts b/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/shared.ts index d219d09e7c8..091321111ce 100644 --- a/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/shared.ts +++ b/libs/@blockprotocol/graph/src/stdlib/subgraph/edge/shared.ts @@ -40,6 +40,7 @@ export const getOntologyEndpointsForOntologyOutwardEdge = ( revisionId = ontologyTypeId.revisionId; } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type const outwardEdges = (subgraph.edges as OntologyRootedEdges)[baseUrl]?.[ revisionId ]; diff --git a/libs/@blockprotocol/graph/src/stdlib/subgraph/roots.ts b/libs/@blockprotocol/graph/src/stdlib/subgraph/roots.ts index 121e01cd7ed..f2363955a0c 100644 --- a/libs/@blockprotocol/graph/src/stdlib/subgraph/roots.ts +++ b/libs/@blockprotocol/graph/src/stdlib/subgraph/roots.ts @@ -46,7 +46,7 @@ export const getRoots = ( )} was missing`, ); - return root.inner as RootType["element"]; + return root.inner; }); /** diff --git a/libs/@blockprotocol/graph/src/util/typed-entries.ts b/libs/@blockprotocol/graph/src/util/typed-entries.ts index 683e3f23437..a6d6cee265e 100644 --- a/libs/@blockprotocol/graph/src/util/typed-entries.ts +++ b/libs/@blockprotocol/graph/src/util/typed-entries.ts @@ -39,7 +39,7 @@ export function typedEntries>( export const typedKeys = >( object: T, ): Entry[0][] => { - return Object.keys(object) as Entry[0][]; + return Object.keys(object); }; /** `Object.values` analogue which returns a well-typed array */ diff --git a/libs/@hashintel/design-system/src/data-type-selector.tsx b/libs/@hashintel/design-system/src/data-type-selector.tsx index 4f8ec470261..df2fbb829de 100644 --- a/libs/@hashintel/design-system/src/data-type-selector.tsx +++ b/libs/@hashintel/design-system/src/data-type-selector.tsx @@ -529,7 +529,7 @@ export const DataTypeSelector = (props: DataTypeSelectorProps) => { onFocus={() => setTextFieldFocused(true)} onBlur={(event) => { const isMenuClick = popoverRef.current?.contains( - event.relatedTarget as Node, + event.relatedTarget, ); if (!isMenuClick) { diff --git a/libs/@hashintel/design-system/src/theme.ts b/libs/@hashintel/design-system/src/theme.ts index d18699f3ff9..f8571a7494b 100644 --- a/libs/@hashintel/design-system/src/theme.ts +++ b/libs/@hashintel/design-system/src/theme.ts @@ -17,7 +17,7 @@ export const theme = createTheme({ boxShadows, dropShadows, /** @todo: figure out how to properly override this type */ - components: components as ThemeOptions["components"], + components, }); export const createEmotionCache = (key?: string) => diff --git a/libs/@hashintel/ds-components/eslint.config.js b/libs/@hashintel/ds-components/eslint.config.js index 8d8ae54d54e..4d83ea5140a 100644 --- a/libs/@hashintel/ds-components/eslint.config.js +++ b/libs/@hashintel/ds-components/eslint.config.js @@ -1,7 +1,5 @@ -import typescriptEslint from "@typescript-eslint/eslint-plugin"; -import reactHooks from "eslint-plugin-react-hooks"; - import { createBase, disableRules } from "@local/eslint/deprecated"; +import { reactHooks, typescriptEslint } from "@local/eslint/plugins"; const disableTypeCheckedRules = typescriptEslint.configs["disable-type-checked"]?.rules ?? {}; diff --git a/libs/@hashintel/query-editor/src/entity-query-editor/query-form/filter-row/property-type-selector.tsx b/libs/@hashintel/query-editor/src/entity-query-editor/query-form/filter-row/property-type-selector.tsx index daa46b067bc..9141e180e1b 100644 --- a/libs/@hashintel/query-editor/src/entity-query-editor/query-form/filter-row/property-type-selector.tsx +++ b/libs/@hashintel/query-editor/src/entity-query-editor/query-form/filter-row/property-type-selector.tsx @@ -27,6 +27,7 @@ export const PropertyTypeSelector = ({ [propertyTypes], ); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive const filterErrors = formState.errors.filters?.[index] as | FieldErrorsImpl | undefined; diff --git a/libs/@local/advanced-types/src/typed-entries.ts b/libs/@local/advanced-types/src/typed-entries.ts index 683e3f23437..a6d6cee265e 100644 --- a/libs/@local/advanced-types/src/typed-entries.ts +++ b/libs/@local/advanced-types/src/typed-entries.ts @@ -39,7 +39,7 @@ export function typedEntries>( export const typedKeys = >( object: T, ): Entry[0][] => { - return Object.keys(object) as Entry[0][]; + return Object.keys(object); }; /** `Object.values` analogue which returns a well-typed array */ diff --git a/libs/@local/eslint/package.json b/libs/@local/eslint/package.json index 599d3258910..ef1e3b10fb5 100644 --- a/libs/@local/eslint/package.json +++ b/libs/@local/eslint/package.json @@ -12,6 +12,10 @@ "./deprecated": { "types": "./dist/deprecated/index.d.ts", "default": "./dist/deprecated/index.js" + }, + "./plugins": { + "types": "./dist/plugins.d.ts", + "default": "./dist/plugins.js" } }, "scripts": { @@ -37,6 +41,7 @@ "eslint-plugin-import": "2.32.0", "eslint-plugin-react-hooks": "7.0.1", "eslint-plugin-react-refresh": "0.5.4", + "eslint-plugin-react-x": "1.17.2", "eslint-plugin-storybook": "10.3.1", "eslint-unicorn": "55.0.0", "globals": "16.4.0", diff --git a/libs/@local/eslint/src/plugins.ts b/libs/@local/eslint/src/plugins.ts new file mode 100644 index 00000000000..92afa7c7913 --- /dev/null +++ b/libs/@local/eslint/src/plugins.ts @@ -0,0 +1,3 @@ +export { default as typescriptEslint } from "@typescript-eslint/eslint-plugin"; +export { default as reactHooks } from "eslint-plugin-react-hooks"; +export { default as reactX } from "eslint-plugin-react-x"; diff --git a/libs/@local/graph/sdk/typescript/src/entity-type.ts b/libs/@local/graph/sdk/typescript/src/entity-type.ts index 8d81965796a..518a369150e 100644 --- a/libs/@local/graph/sdk/typescript/src/entity-type.ts +++ b/libs/@local/graph/sdk/typescript/src/entity-type.ts @@ -116,10 +116,8 @@ export const queryEntityTypes = ( | undefined, entityTypes: mapGraphApiEntityTypesToEntityTypes(response.entityTypes), cursor: response.cursor as VersionedUrl | undefined, - webIds: response.webIds as Record | undefined, - editionCreatedByIds: response.editionCreatedByIds as - | Record - | undefined, + webIds: response.webIds, + editionCreatedByIds: response.editionCreatedByIds, })); export type SearchEntityTypesRequest = DistributiveOmit< @@ -186,10 +184,8 @@ export const queryEntityTypeSubgraph = ( ...response, subgraph: mapGraphApiSubgraphToSubgraph(response.subgraph), cursor: response.cursor as VersionedUrl | undefined, - webIds: response.webIds as Record | undefined, - editionCreatedByIds: response.editionCreatedByIds as - | Record - | undefined, + webIds: response.webIds, + editionCreatedByIds: response.editionCreatedByIds, })); export const serializeQueryEntityTypeSubgraphResponse = ( diff --git a/libs/@local/graph/sdk/typescript/src/entity.ts b/libs/@local/graph/sdk/typescript/src/entity.ts index 54c07a262d9..e78f1062f9a 100644 --- a/libs/@local/graph/sdk/typescript/src/entity.ts +++ b/libs/@local/graph/sdk/typescript/src/entity.ts @@ -125,6 +125,7 @@ export type BrandedPropertyObject> = export const brandPropertyObject = >( obj: T, ): BrandedPropertyObject => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive return obj as BrandedPropertyObject; }; @@ -1519,7 +1520,7 @@ export class HashLinkEntity< ); } - super(input as EntityInput); + super(input); } public static async createMultiple( @@ -1589,7 +1590,7 @@ export class HashLinkEntity< }: PatchEntityParameters): GraphApiPatchEntityParams { if (propertyPatches) { const isUserEntity = this.metadata.entityTypeIds.some((id) => - id.startsWith(userEntityTypeBaseUrl as string), + id.startsWith(userEntityTypeBaseUrl), ); if (isUserEntity) { @@ -1684,17 +1685,11 @@ export const summarizeEntities = async ( .summarizeEntities(authentication.actorId, params) .then(({ data: response }) => ({ ...response, - webIds: response.webIds as Record | undefined, - createdByIds: response.createdByIds as - | Record - | undefined, - editionCreatedByIds: response.editionCreatedByIds as - | Record - | undefined, - typeIds: response.typeIds as Record | undefined, - typeTitles: response.typeTitles as - | Record - | undefined, + webIds: response.webIds, + createdByIds: response.createdByIds, + editionCreatedByIds: response.editionCreatedByIds, + typeIds: response.typeIds, + typeTitles: response.typeTitles, })); export const queryEntitiesTable = async ( @@ -1709,7 +1704,7 @@ export const queryEntitiesTable = async ( .then(({ data: response }) => ({ ...response, rows: response.rows as QueryEntitiesTableResponse["rows"], - summary: response.summary as QueryEntitiesTableResponse["summary"], + summary: response.summary, closedMultiEntityTypes: response.closedMultiEntityTypes ? mapGraphApiClosedMultiEntityTypeMapToClosedMultiEntityTypeMap( response.closedMultiEntityTypes, diff --git a/libs/@local/graph/sdk/typescript/src/subgraph.ts b/libs/@local/graph/sdk/typescript/src/subgraph.ts index 1b3e9fcbde9..663ef40a9a9 100644 --- a/libs/@local/graph/sdk/typescript/src/subgraph.ts +++ b/libs/@local/graph/sdk/typescript/src/subgraph.ts @@ -128,7 +128,7 @@ export const deserializeSubgraph = < >( subgraph: SerializedSubgraph, ): Subgraph => ({ - roots: subgraph.roots as RootType["vertexId"][], + roots: subgraph.roots, vertices: deserializeGraphVertices(subgraph.vertices), edges: subgraph.edges, temporalAxes: subgraph.temporalAxes, diff --git a/libs/@local/harpc/client/typescript/src/binary/MutableBytes.ts b/libs/@local/harpc/client/typescript/src/binary/MutableBytes.ts index f88e632c0ca..47038f86f88 100644 --- a/libs/@local/harpc/client/typescript/src/binary/MutableBytes.ts +++ b/libs/@local/harpc/client/typescript/src/binary/MutableBytes.ts @@ -62,7 +62,7 @@ export const make = (options?: MakeOptions): MutableBytes => options?.initialCapacity ?? DEFAULT_INITIAL_CAPACITY, ), }, - ) satisfies MutableBytesImpl as MutableBytes; + ) satisfies MutableBytesImpl; interface FromOptions { /** @@ -87,7 +87,7 @@ export const from = ( length: buffer.byteLength, inner: buffer, }, - ) satisfies MutableBytesImpl as MutableBytes; + ) satisfies MutableBytesImpl; export const capacity = (self: MutableBytes) => (self as MutableBytesImpl).inner.byteLength; diff --git a/libs/@local/harpc/client/typescript/src/codec/JsonEncoder.ts b/libs/@local/harpc/client/typescript/src/codec/JsonEncoder.ts index 76e4d68c4f5..5d54fa1fcf9 100644 --- a/libs/@local/harpc/client/typescript/src/codec/JsonEncoder.ts +++ b/libs/@local/harpc/client/typescript/src/codec/JsonEncoder.ts @@ -28,7 +28,7 @@ const encoder = (options: Options) => const array = textEncoder.encode(text); // assertion is necessary because dom libraries don't support `TextEncoder` yet. - return array.buffer as unknown as ArrayBuffer; + return array.buffer; }), ), ); diff --git a/libs/@local/harpc/client/typescript/src/net/Client.ts b/libs/@local/harpc/client/typescript/src/net/Client.ts index a403fdcba9e..ed2dbb49eef 100644 --- a/libs/@local/harpc/client/typescript/src/net/Client.ts +++ b/libs/@local/harpc/client/typescript/src/net/Client.ts @@ -41,7 +41,7 @@ export const make = Effect.fn("make")(function* (config?: ClientConfig) { return createProto(ClientProto, { client, config, - }) satisfies ClientImpl as Client; + }) satisfies ClientImpl; }); export const layer = (config?: ClientConfig) => diff --git a/libs/@local/harpc/client/typescript/src/net/Connection.ts b/libs/@local/harpc/client/typescript/src/net/Connection.ts index ee04adf8e4b..6842be2e411 100644 --- a/libs/@local/harpc/client/typescript/src/net/Connection.ts +++ b/libs/@local/harpc/client/typescript/src/net/Connection.ts @@ -277,7 +277,7 @@ export const makeUnchecked = Effect.fn("makeUnchecked")(function* ( // TODO: we might want to observe the task, for that we would need to have a partial connection that we then patch yield* Effect.fork(task(self)); - return self as Connection; + return self; }); // these bounds are stricter than required, as we have no way to inform the remote about a failure in the underlying stream, diff --git a/libs/@local/harpc/client/typescript/src/net/Request.ts b/libs/@local/harpc/client/typescript/src/net/Request.ts index 8536cd878a7..d072c891972 100644 --- a/libs/@local/harpc/client/typescript/src/net/Request.ts +++ b/libs/@local/harpc/client/typescript/src/net/Request.ts @@ -58,7 +58,7 @@ export const make = Effect.fn("make")(function* ( subsystem, procedure, body, - }) as Request; + }); }); interface Scratch { diff --git a/libs/@local/harpc/client/typescript/src/net/Transaction.ts b/libs/@local/harpc/client/typescript/src/net/Transaction.ts index 460481160a2..485aa60f03f 100644 --- a/libs/@local/harpc/client/typescript/src/net/Transaction.ts +++ b/libs/@local/harpc/client/typescript/src/net/Transaction.ts @@ -31,8 +31,7 @@ export const makeUnchecked = ( id: RequestId.RequestId, readQueue: Queue.Dequeue, drop: Deferred.Deferred, -): Transaction => - createProto(TransactionProto, { id, read: readQueue, drop }) as Transaction; +): Transaction => createProto(TransactionProto, { id, read: readQueue, drop }); // eslint-disable-next-line fsecond/no-inline-interfaces export const registerDestructor: { diff --git a/libs/@local/harpc/client/typescript/src/net/internal/dns.ts b/libs/@local/harpc/client/typescript/src/net/internal/dns.ts index 1e53645ae67..d2a70a503b8 100644 --- a/libs/@local/harpc/client/typescript/src/net/internal/dns.ts +++ b/libs/@local/harpc/client/typescript/src/net/internal/dns.ts @@ -100,7 +100,7 @@ export const resolve = Effect.fn("resolve")(function* ( address: hostname, timeToLive: Duration.infinity, - } as DnsRecord, + }, ]; } } @@ -115,7 +115,7 @@ export const resolve = Effect.fn("resolve")(function* ( address: hostname, timeToLive: Duration.infinity, - } as DnsRecord, + }, ]; } } @@ -169,21 +169,19 @@ export const lookup = Effect.fn("lookup")(function* ( // we cannot determine the TTL of lookup records, therefore we set it to infinity // `getaddrinfo` (the underlying call used by dns.lookup) does not return TTLs const aRecords = satisfying.map( - (record) => - ({ - type: "A", - address: record.address, - timeToLive: Duration.infinity, - }) as DnsRecord, + (record): DnsRecord => ({ + type: "A", + address: record.address, + timeToLive: Duration.infinity, + }), ); const aaaaRecords = excluded.map( - (record) => - ({ - type: "AAAA", - address: record.address, - timeToLive: Duration.infinity, - }) as DnsRecord, + (record): DnsRecord => ({ + type: "AAAA", + address: record.address, + timeToLive: Duration.infinity, + }), ); const output: DnsRecord[] = []; diff --git a/libs/@local/harpc/client/typescript/src/wire-protocol/RequestIdProducer.ts b/libs/@local/harpc/client/typescript/src/wire-protocol/RequestIdProducer.ts index 5c7081932f0..8a2ed6c4cad 100644 --- a/libs/@local/harpc/client/typescript/src/wire-protocol/RequestIdProducer.ts +++ b/libs/@local/harpc/client/typescript/src/wire-protocol/RequestIdProducer.ts @@ -30,7 +30,7 @@ export const RequestIdProducer = GenericTag( const make = Effect.fn("make")(function* () { const next = yield* Ref.make(0); - return createProto(RequestIdProducerProto, { next }) as RequestIdProducer; + return createProto(RequestIdProducerProto, { next }); }); export const layer = Layer.effect(RequestIdProducer, make()); diff --git a/libs/@local/harpc/client/typescript/tests/codec/JsonDecoder.test.ts b/libs/@local/harpc/client/typescript/tests/codec/JsonDecoder.test.ts index b715e4e6c6b..08aeac84a2c 100644 --- a/libs/@local/harpc/client/typescript/tests/codec/JsonDecoder.test.ts +++ b/libs/@local/harpc/client/typescript/tests/codec/JsonDecoder.test.ts @@ -30,7 +30,7 @@ const decode = Effect.fn("decode")(function* ( ); // explicit type annotation needed for eslint - return (yield* effect) as readonly ReadonlyRecord[]; + return yield* effect; }); describe.concurrent("JsonDecoder", () => { diff --git a/libs/@local/hash-backend-utils/src/create-graph-client.ts b/libs/@local/hash-backend-utils/src/create-graph-client.ts index f05cedd821b..3d381edd80f 100644 --- a/libs/@local/hash-backend-utils/src/create-graph-client.ts +++ b/libs/@local/hash-backend-utils/src/create-graph-client.ts @@ -54,7 +54,7 @@ class GraphApiError extends Error { if (axiosError.response) { if (isStatus(responseData)) { super(responseData.message); - this.status = responseData as GraphStatus; + this.status = responseData; } else if (typeof responseData === "string") { const message = `Error from Graph API: ${responseData}`; super(message); diff --git a/libs/@local/hash-backend-utils/src/logger.ts b/libs/@local/hash-backend-utils/src/logger.ts index 438b1ae8481..e30387d0203 100644 --- a/libs/@local/hash-backend-utils/src/logger.ts +++ b/libs/@local/hash-backend-utils/src/logger.ts @@ -286,8 +286,8 @@ class OpenTelemetryLogTransport extends Transport { const spanContext = trace.getActiveSpan()?.spanContext(); if (spanContext) { - attributes.trace_id = spanContext.traceId as AnyValue; - attributes.span_id = spanContext.spanId as AnyValue; + attributes.trace_id = spanContext.traceId; + attributes.span_id = spanContext.spanId; } otelLogger.emit({ diff --git a/libs/@local/hash-backend-utils/src/notifications.ts b/libs/@local/hash-backend-utils/src/notifications.ts index 186742282c8..85a42cac94a 100644 --- a/libs/@local/hash-backend-utils/src/notifications.ts +++ b/libs/@local/hash-backend-utils/src/notifications.ts @@ -66,7 +66,7 @@ export const createGraphChangeNotification = async ( { draft: false, entityTypeIds: [systemEntityTypes.graphChangeNotification.entityTypeId], - webId: notifiedUserAccountId as WebId, + webId: notifiedUserAccountId, properties: { value: { "https://hash.ai/@h/types/property-type/graph-change-type/": { @@ -95,7 +95,7 @@ export const createGraphChangeNotification = async ( { draft: false, entityTypeIds: [systemLinkEntityTypes.occurredInEntity.linkEntityTypeId], - webId: notifiedUserAccountId as WebId, + webId: notifiedUserAccountId, linkData: { leftEntityId: notificationEntity.metadata.recordId.entityId, rightEntityId: changedEntityId, diff --git a/libs/@local/hash-backend-utils/src/opentelemetry.test.ts b/libs/@local/hash-backend-utils/src/opentelemetry.test.ts index 361b852e761..fab74b90816 100644 --- a/libs/@local/hash-backend-utils/src/opentelemetry.test.ts +++ b/libs/@local/hash-backend-utils/src/opentelemetry.test.ts @@ -261,8 +261,7 @@ describe("createHttpInstrumentation OTLP-port filter", () => { if (!hook) { throw new Error("ignoreOutgoingRequestHook should be set"); } - return (port: number | string | undefined) => - hook({ port } as Parameters>[0]); + return (port: number | string | undefined) => hook({ port }); }; it("ignores outgoing requests to the configured OTLP gRPC port", () => { diff --git a/libs/@local/hash-isomorphic-utils/src/blocks.ts b/libs/@local/hash-isomorphic-utils/src/blocks.ts index 7a44f53a89d..2a3408d364e 100644 --- a/libs/@local/hash-isomorphic-utils/src/blocks.ts +++ b/libs/@local/hash-isomorphic-utils/src/blocks.ts @@ -126,7 +126,7 @@ const transformBlockConfig = ({ schema: deriveAbsoluteUrl({ baseUrl, path: metadata.schema, - }) as VersionedUrl, + }), source: deriveAbsoluteUrl({ baseUrl, path: metadata.source }), }; }; diff --git a/libs/@local/hash-isomorphic-utils/src/create-apollo-client.ts b/libs/@local/hash-isomorphic-utils/src/create-apollo-client.ts index 6a7bdd63d7f..8137525a32c 100644 --- a/libs/@local/hash-isomorphic-utils/src/create-apollo-client.ts +++ b/libs/@local/hash-isomorphic-utils/src/create-apollo-client.ts @@ -86,6 +86,7 @@ export const createApolloClient = (params?: { const httpLink = new HttpLink({ uri: apiGraphQLEndpoint, credentials: "include", + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive fetch: wrappedFetch as WindowOrWorkerGlobalScope["fetch"], headers, }); diff --git a/libs/@local/hash-isomorphic-utils/src/production-schedule/validation.ts b/libs/@local/hash-isomorphic-utils/src/production-schedule/validation.ts index 95e993d8cca..5f5f7d7b3e0 100644 --- a/libs/@local/hash-isomorphic-utils/src/production-schedule/validation.ts +++ b/libs/@local/hash-isomorphic-utils/src/production-schedule/validation.ts @@ -504,7 +504,7 @@ export const parseProductionSchedule = ( }, ]); } - return schedule as ProductionSchedule; + return schedule; }; export const safeParseProductionSchedule = ( diff --git a/libs/@local/hash-isomorphic-utils/src/service-usage.ts b/libs/@local/hash-isomorphic-utils/src/service-usage.ts index 096aac733ce..ad87bae8c86 100644 --- a/libs/@local/hash-isomorphic-utils/src/service-usage.ts +++ b/libs/@local/hash-isomorphic-utils/src/service-usage.ts @@ -202,9 +202,9 @@ export const getAggregateUsageRecordsByTask = ({ const { inputUnitCount, outputUnitCount, customMetadata } = simplifyProperties(record.properties); - const taskName = ( - customMetadata as FlowUsageRecordCustomMetadata | undefined - )?.taskName; + const taskName = + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive + (customMetadata as FlowUsageRecordCustomMetadata | undefined)?.taskName; if (!taskName) { continue; } diff --git a/package.json b/package.json index f908b19aec2..3d23fd6c509 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "devDependencies": { "@changesets/cli": "patch:@changesets/cli@npm%3A3.0.3#~/.yarn/patches/@changesets-cli-npm-3.0.3-37da92ed6c.patch", "@yarnpkg/types": "^4.0.1", + "eslint-plugin-react-hooks": "7.0.1", "lefthook": "2.2.0", "npm-run-all2": "8.0.4", "oxfmt": "0.71.0" diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/entity.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/entity.test.ts index 22bb68aedec..eb2fe0f788f 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/entity.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/entity.test.ts @@ -105,7 +105,7 @@ describe("Entity CRU", () => { await Promise.all([ createEntityType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Friends", description: "Friend of", @@ -122,7 +122,7 @@ describe("Entity CRU", () => { throw err; }), createPropertyType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Favorite Book", description: "The favorite book of a person", @@ -137,7 +137,7 @@ describe("Entity CRU", () => { throw err; }), createPropertyType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Name", description: "The name of a person", @@ -421,7 +421,7 @@ describe("Entity CRU", () => { graphContext, { actorId: testUser.accountId }, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, // First create a new entity given the following definition entityTypeIds: [entityType.schema.$id], properties: { @@ -483,7 +483,7 @@ describe("Entity CRU", () => { graphContext, { actorId: testUser.accountId }, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, entityUuid: rootEntityUuid, entityTypeIds: [entityType.schema.$id], properties: { @@ -577,7 +577,7 @@ describe("Entity CRU", () => { await expect( createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: { "https://blockprotocol.org/@blockprotocol/types/property-type/display-name/": @@ -609,7 +609,7 @@ describe("Entity CRU", () => { await expect( createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: { "https://blockprotocol.org/@blockprotocol/types/property-type/display-name/": @@ -650,7 +650,7 @@ describe("Entity CRU", () => { await expect( createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: { "https://blockprotocol.org/@blockprotocol/types/property-type/display-name/": @@ -688,7 +688,7 @@ describe("Entity CRU", () => { await expect( createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: { "https://hash.ai/@h/types/property-type/shortname/": { @@ -725,7 +725,7 @@ describe("Entity CRU", () => { await expect( createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: { "https://hash.ai/@h/types/property-type/org-self-registration-is-enabled/": diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/link-entity.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/link-entity.test.ts index aa5210b7407..241f74443fc 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/link-entity.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/primitive/link-entity.test.ts @@ -58,7 +58,7 @@ describe("Link entity", () => { graphContext, { actorId: testUser.accountId }, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: generateSystemEntityTypeSchema({ entityTypeId, ...params, @@ -81,7 +81,7 @@ describe("Link entity", () => { await Promise.all([ createEntityType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Friends", description: "Friend of", @@ -93,7 +93,7 @@ describe("Link entity", () => { friendLinkEntityType = linkEntityType; }), createEntityType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Acquaintance", description: "Acquainted with", @@ -124,21 +124,21 @@ describe("Link entity", () => { await Promise.all([ createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, entityTypeIds: [testEntityType.schema.$id], properties: { value: {} }, }).then((entity) => { leftEntity = entity; }), createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, entityTypeIds: [testEntityType.schema.$id], properties: { value: {} }, }).then((entity) => { friendRightEntity = entity; }), createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, entityTypeIds: [testEntityType.schema.$id], properties: { value: {} }, }).then((entity) => { @@ -160,7 +160,7 @@ describe("Link entity", () => { const authentication = { actorId: testUser.accountId }; linkEntityFriend = await createLinkEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: {} }, linkData: { leftEntityId: leftEntity.metadata.recordId.entityId, @@ -173,7 +173,7 @@ describe("Link entity", () => { graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: {} }, linkData: { leftEntityId: leftEntity.metadata.recordId.entityId, diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/block.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/block.test.ts index bbf23d13a06..b0e0efa15fe 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/block.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/block.test.ts @@ -55,7 +55,7 @@ describe("Block", () => { * once the exact role of the block data entity's entity type is known. */ dummyEntityType = await createEntityType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: generateSystemEntityTypeSchema({ entityTypeId: generateTypeId({ kind: "entity-type", @@ -70,7 +70,7 @@ describe("Block", () => { }); testBlockDataEntity = await createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: {} }, entityTypeIds: [dummyEntityType.schema.$id], }); @@ -86,7 +86,7 @@ describe("Block", () => { const authentication = { actorId: testUser.accountId }; testBlock = await createBlock(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, componentId: testBlockComponentId, blockData: testBlockDataEntity, }); @@ -121,7 +121,7 @@ describe("Block", () => { graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, properties: { value: {} }, entityTypeIds: [dummyEntityType.schema.$id], }, diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment.test.ts index 81050f00a67..06f55066833 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/comment.test.ts @@ -56,13 +56,13 @@ describe("Comment", () => { graphContext, { actorId: testUser.accountId }, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, componentId: "text", blockData: await createEntity( graphContext, { actorId: testUser.accountId }, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, entityTypeIds: [systemEntityTypes.text.entityTypeId], properties: { value: { @@ -77,7 +77,7 @@ describe("Comment", () => { testPage = await createPage(graphContext, authentication, { initialBlocks: [initialBlock], - webId: testUser.accountId as WebId, + webId: testUser.accountId, title: "test page", type: "document", }); @@ -100,7 +100,7 @@ describe("Comment", () => { const authentication = { actorId: testUser.accountId }; const comment = await createComment(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, parentEntityId: testBlock.entity.metadata.recordId.entityId, textualContent: [], author: testUser, diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/mention-notification.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/mention-notification.test.ts index c2527375e67..aae600499de 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/mention-notification.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/mention-notification.test.ts @@ -99,7 +99,7 @@ describe.skip("Page Mention Notification", () => { occurredInEntity = await createPage(graphContext, authentication, { title: "Test Page", - webId: triggerUser.accountId as WebId, + webId: triggerUser.accountId, type: "document", }); @@ -130,7 +130,7 @@ describe.skip("Page Mention Notification", () => { occurredInEntity, occurredInText, occurredInBlock, - webId: recipientUser.accountId as WebId, + webId: recipientUser.accountId, }, ); @@ -385,7 +385,7 @@ describe.skip("Page Mention Notification", () => { { actorId: triggerUser.accountId }, { parentEntityId: occurredInBlock.entity.metadata.recordId.entityId, - webId: triggerUser.accountId as WebId, + webId: triggerUser.accountId, textualContent: [ { mentionType: "user", @@ -535,7 +535,7 @@ describe("Entity Mention Notification", () => { { triggeredByUser: triggerUser, occurredInEntity: recipientUser, - webId: recipientUser.accountId as WebId, + webId: recipientUser.accountId, }, ); const outgoingLinks = await getEntityOutgoingLinks( diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/org-invitation-email-casing.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/org-invitation-email-casing.test.ts index e254d7f5c86..b6a7e923e86 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/org-invitation-email-casing.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/org-invitation-email-casing.test.ts @@ -51,7 +51,7 @@ const graphQLContextForUser = (user: User): LoggedInGraphQLContext => ({ }, emailTransporter: { sendMail: async () => {}, - } as unknown as EmailTransporter, + }, logger, authentication: { actorId: user.accountId }, user, diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/page.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/page.test.ts index 9a11955d3ae..0e1d89b692b 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/page.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/page.test.ts @@ -64,7 +64,7 @@ describe("Page", () => { const authentication = { actorId: testUser.accountId }; const blockData = await createEntity(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, entityTypeIds: [systemEntityTypes.text.entityTypeId], properties: { value: { @@ -75,7 +75,7 @@ describe("Page", () => { }); return createBlock(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, componentId: "text", blockData, }); @@ -87,7 +87,7 @@ describe("Page", () => { const authentication = { actorId: testUser.accountId }; testPage = await createPage(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, title: "Test Page", type: "document", }); @@ -106,7 +106,7 @@ describe("Page", () => { ]); testPage2 = await createPage(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, title: "Test Page 2", summary: "Test page 2 summary", initialBlocks: [initialBlock1, initialBlock2], @@ -144,7 +144,7 @@ describe("Page", () => { graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, }, ); @@ -169,7 +169,7 @@ describe("Page", () => { const authentication = { actorId: testUser.accountId }; parentPage = await createPage(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, title: "Test Parent Page", summary: "Test page summary", type: "document", @@ -213,7 +213,7 @@ describe("Page", () => { authentication, { initialBlocks: [firstBlock], - webId: testUser.accountId as WebId, + webId: testUser.accountId, title: "Test Page for Block Manipulation", type: "document", }, diff --git a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/user.test.ts b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/user.test.ts index 56cc15bd385..708c4ad7f94 100644 --- a/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/user.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/knowledge/system-types/user.test.ts @@ -75,7 +75,7 @@ const graphQLContextForUser = (user: User): LoggedInGraphQLContext => ({ }, emailTransporter: { sendMail: async () => {}, - } as unknown as EmailTransporter, + }, logger, authentication: { actorId: user.accountId }, user, diff --git a/tests/hash-backend-integration/src/tests/graph/ontology/primitive/entity-type.test.ts b/tests/hash-backend-integration/src/tests/graph/ontology/primitive/entity-type.test.ts index 47027145b9d..0ac40774718 100644 --- a/tests/hash-backend-integration/src/tests/graph/ontology/primitive/entity-type.test.ts +++ b/tests/hash-backend-integration/src/tests/graph/ontology/primitive/entity-type.test.ts @@ -103,7 +103,7 @@ beforeAll(async () => { await Promise.all([ createEntityType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Worker", description: "A worker", @@ -114,7 +114,7 @@ beforeAll(async () => { workerEntityType = val; }), createEntityType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Address", description: "An address", @@ -125,7 +125,7 @@ beforeAll(async () => { addressEntityType = val; }), createPropertyType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Favorite Book", description: "Favorite book of the user", @@ -135,7 +135,7 @@ beforeAll(async () => { favoriteBookPropertyType = val; }), createPropertyType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Name", description: "The name of the user", @@ -145,7 +145,7 @@ beforeAll(async () => { namePropertyType = val; }), createEntityType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Knows", description: "Knows of someone", @@ -158,7 +158,7 @@ beforeAll(async () => { knowsLinkEntityType = val; }), createEntityType(graphContext, authentication, { - webId: testUser.accountId as WebId, + webId: testUser.accountId, schema: { title: "Previous Address", description: "A previous address of something.", @@ -381,16 +381,13 @@ describe("Entity type CRU", () => { } const allOf = atLeastOne( - closedEntityTypes!.map( - (closedEntityType) => - ({ - $id: closedEntityType.$id, - title: closedEntityType.title, - titlePlural: closedEntityType.titlePlural, - description: closedEntityType.description, - allOf: closedEntityType.allOf, - }) as ClosedMultiEntityType["allOf"][0], - ), + closedEntityTypes!.map((closedEntityType) => ({ + $id: closedEntityType.$id, + title: closedEntityType.title, + titlePlural: closedEntityType.titlePlural, + description: closedEntityType.description, + allOf: closedEntityType.allOf, + })), ); assert(allOf !== undefined); allOf.sort((a, b) => a.$id.localeCompare(b.$id)); diff --git a/tests/hash-backend-integration/src/tests/subgraph/circular.test.ts b/tests/hash-backend-integration/src/tests/subgraph/circular.test.ts index fe04fba1c47..a4c3c1c25ba 100644 --- a/tests/hash-backend-integration/src/tests/subgraph/circular.test.ts +++ b/tests/hash-backend-integration/src/tests/subgraph/circular.test.ts @@ -172,6 +172,7 @@ const edgesEquals = ( } return edges.every(({ source, edges: outwardEdges }) => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type const subgraphEdge = (subgraph.edges as KnowledgeGraphRootedEdges)[ source.metadata.recordId.entityId ]![source.metadata.temporalVersioning.decisionTime.start.limit]!; diff --git a/tests/hash-backend-integration/src/tests/subgraph/friendship.test.ts b/tests/hash-backend-integration/src/tests/subgraph/friendship.test.ts index ccfbf8eb99a..ff8531d1ce8 100644 --- a/tests/hash-backend-integration/src/tests/subgraph/friendship.test.ts +++ b/tests/hash-backend-integration/src/tests/subgraph/friendship.test.ts @@ -849,6 +849,7 @@ describe("non-zero, simple resolve depths", () => { ).toEqual(1); expect( Object.keys( + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type (subgraph.edges as KnowledgeGraphRootedEdges)[ friendshipEntity.metadata.recordId.entityId ]![ @@ -918,6 +919,7 @@ describe("non-zero, simple resolve depths", () => { expect( Object.keys( + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type (subgraph.edges as KnowledgeGraphRootedEdges)[ friendshipEntity.metadata.recordId.entityId ]![ @@ -1162,6 +1164,7 @@ describe("complex resolve depths", () => { const aliceEntity = roots[0]!; expect(aliceEntity).toStrictEqual(aliceEntities[aliceEntities.length - 1]); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type const personTypes = (subgraph.edges as KnowledgeGraphRootedEdges) [aliceEntity.metadata.recordId.entityId]![ aliceEntity.metadata.temporalVersioning.decisionTime.start.limit @@ -1184,6 +1187,7 @@ describe("complex resolve depths", () => { expect(links.length).toEqual(1); const link = links[0]!; + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: type is narrowed beforehand to make sure that indexing results in the right type const linkTypes = (subgraph.edges as KnowledgeGraphRootedEdges) [link.metadata.recordId.entityId]![ link.metadata.temporalVersioning.decisionTime.start.limit diff --git a/yarn.lock b/yarn.lock index db6a15fabe2..643d7c7a412 100644 --- a/yarn.lock +++ b/yarn.lock @@ -732,7 +732,6 @@ __metadata: elkjs: "npm:0.11.0" emoji-mart: "npm:5.6.0" eslint: "npm:9.39.4" - eslint-plugin-react-x: "npm:1.17.2" fractional-indexing: "npm:3.2.0" framer-motion: "npm:11.18.2" graphology: "npm:0.26.0" @@ -9727,6 +9726,7 @@ __metadata: eslint-plugin-import: "npm:2.32.0" eslint-plugin-react-hooks: "npm:7.0.1" eslint-plugin-react-refresh: "npm:0.5.4" + eslint-plugin-react-x: "npm:1.17.2" eslint-plugin-storybook: "npm:10.3.1" eslint-unicorn: "npm:55.0.0" globals: "npm:16.4.0" @@ -29194,6 +29194,7 @@ __metadata: dependencies: "@changesets/cli": "patch:@changesets/cli@npm%3A3.0.3#~/.yarn/patches/@changesets-cli-npm-3.0.3-37da92ed6c.patch" "@yarnpkg/types": "npm:^4.0.1" + eslint-plugin-react-hooks: "npm:7.0.1" lefthook: "npm:2.2.0" npm-run-all2: "npm:8.0.4" oxfmt: "npm:0.71.0" From e7c56646f52776be220ed59c06c646f80c00a378 Mon Sep 17 00:00:00 2001 From: Bilal Mahmoud <7252775+indietyp@users.noreply.github.com> Date: Wed, 7 Oct 2026 09:42:36 +0200 Subject: [PATCH 07/13] chore: remove redundant type assertions --- .../src/analysis/analyses/dashboards.test.ts | 1 - .../resolve-analysis.test.ts | 6 +-- .../auth/kratos-endpoint-allowlist.test.ts | 2 +- ...user-before-update-entity-hook-callback.ts | 6 +-- .../knowledge/system-types/user-secret.ts | 1 - .../user/submit-early-access-form.ts | 1 - .../graphql/resolvers/ontology/entity-type.ts | 1 - .../resolvers/ontology/property-type.ts | 1 - .../src/integrations/google/oauth-callback.ts | 1 - .../hash-api/src/integrations/linear/oauth.ts | 1 - .../src/blocks/use-fetch-block-subgraph.ts | 18 +++----- .../components/block-loader/block-loader.tsx | 5 +- .../sandbox/framed-block/framed-block.tsx | 5 +- .../atlas-decode/edge-document.ts | 4 +- .../atlas-decode/envelope.test.ts | 8 ++-- .../atlas-decode/envelope.ts | 2 +- .../atlas-decode/iterable.test.ts | 2 +- .../atlas-decode/locate-document.ts | 2 +- .../atlas-decode/locate-document/head.ts | 2 +- .../atlas-decode/option.test.ts | 4 +- .../atlas-decode/result.composition.test.ts | 6 +-- .../atlas-decode/tile-document.ts | 2 +- .../atlas-decode/tile-document/head.ts | 6 +-- .../atlas-decode/tile-document/trailer.ts | 2 +- .../tiling/fetch-edges-for-tiles.test.ts | 4 +- .../tiling/fetch-locate.test.ts | 8 ++-- .../tiling/fetch-tile.test.ts | 20 ++++---- apps/hash-frontend/src/lib/user-and-org.ts | 2 +- .../edit-pinned-entity-types-modal.tsx | 4 +- .../user-profile-info-form.tsx | 5 +- .../user-profile-info-modal-header.tsx | 3 +- .../pinned-entity-type-tab-contents.tsx | 6 +-- .../shared/flow-visualizer/activity-log.tsx | 3 +- .../outputs/entity-result-table.tsx | 4 ++ .../[...slug-maybe-version].page.test.tsx | 2 +- .../draft-entities/draft-entities-filters.tsx | 4 +- .../world-map-renderer.tsx | 2 +- .../structural-query-builder.tsx | 46 +++++++++---------- .../hooks/use-dashboard-item-config.ts | 2 +- .../hooks/use-dashboard-item-generations.ts | 2 +- .../waitlisted/early-access-modal.tsx | 5 +- .../convert-quick-note-to-page-modal.tsx | 6 +-- .../pages/notes.page/create-quick-note.tsx | 3 +- .../pages/notes.page/editable-quick-note.tsx | 6 +-- .../notifications-with-links-context.ts | 4 +- .../block-config-menu/block-config-menu.tsx | 1 + .../block-select-data-modal.tsx | 3 +- .../load-entity-menu-content.tsx | 6 +-- .../comments/comment-text-field.tsx | 3 +- .../block-collection/component-view.tsx | 3 +- .../create-suggester/create-suggester.tsx | 2 +- .../src/pages/shared/claims-table.tsx | 3 ++ .../shared/enum-editor.tsx | 3 +- .../entities-visualizer/entities-table.tsx | 2 +- .../shared/displays-files-only.test.ts | 2 +- ...le-data-from-endpoint-rows.browser.test.ts | 2 +- .../edit-bar-type-editor.test.tsx | 2 +- .../use-entity-type-dependents.ts | 2 +- .../history-table/shared/event-detail.tsx | 7 +-- .../create-draft-link-entity.ts | 10 ++-- .../linked-entity-selector.tsx | 2 +- .../value-cell/editor-type-picker.test.tsx | 2 +- .../use-rows/use-property-rows-from-entity.ts | 8 ++-- .../src/pages/shared/entity/query-editor.tsx | 3 +- .../shared/filter-bar/use-internal-webs.ts | 3 +- .../src/pages/shared/web-selector.tsx | 2 +- .../shared/workspace-context-provider.tsx | 5 +- apps/hash-frontend/src/pages/signin.page.tsx | 3 +- .../src/pages/supply-chain/shared/data.ts | 4 +- .../status-dialog/status-editor.test.tsx | 2 +- .../step-detail-panel/data-table-section.tsx | 4 +- .../supply-chain/shared/use-search-params.ts | 2 +- .../product/process-graph.tsx | 6 +-- .../product/production-schedule.test.tsx | 46 +++++++++---------- .../timeline-tooltip.test.tsx | 23 +++++----- .../shared/supply-chain-filters/operators.ts | 2 +- ...ase64-baseurl-maybe-version].page.test.tsx | 2 +- .../sidebar/workspace-switcher.tsx | 4 +- .../shared/split-properties-and-metadata.ts | 1 - libs/@hashintel/design-system/src/theme.ts | 2 - .../src/components/Avatar/avatar.tsx | 13 ++---- .../src/components/Banner/banner.tsx | 2 +- .../Chart/NetworkGraph/network-graph.tsx | 8 ++-- .../src/components/Combobox/combobox.tsx | 8 ++-- .../src/components/Filter/filter.tsx | 2 +- .../src/components/Menu/menu.stories.tsx | 4 +- .../right-click-menu.stories.tsx | 4 +- .../src/components/Select/select.stories.tsx | 4 +- .../src/components/Select/select.tsx | 2 +- .../src/util/radio-checkbox-group-shared.ts | 4 +- libs/@local/eslint/src/deprecated/base.ts | 1 + libs/@local/eslint/src/typescript.ts | 1 + .../tests/codec/JsonDecoder.test.ts | 1 - .../hash-backend-utils/src/notifications.ts | 1 - .../hash-isomorphic-utils/src/blocks.ts | 2 +- .../graph/knowledge/primitive/entity.test.ts | 1 - .../knowledge/primitive/link-entity.test.ts | 2 +- .../knowledge/system-types/block.test.ts | 2 +- .../knowledge/system-types/comment.test.ts | 1 - .../system-types/mention-notification.test.ts | 1 - .../org-invitation-email-casing.test.ts | 1 - .../graph/knowledge/system-types/page.test.ts | 1 - .../graph/knowledge/system-types/user.test.ts | 1 - .../ontology/primitive/entity-type.test.ts | 1 - 104 files changed, 198 insertions(+), 277 deletions(-) diff --git a/apps/hash-api/src/analysis/analyses/dashboards.test.ts b/apps/hash-api/src/analysis/analyses/dashboards.test.ts index d655d210d9a..3ce4f88280c 100644 --- a/apps/hash-api/src/analysis/analyses/dashboards.test.ts +++ b/apps/hash-api/src/analysis/analyses/dashboards.test.ts @@ -9,7 +9,6 @@ import { import type { ActorEntityUuid, MachineId, - RoleName, WebId, } from "@blockprotocol/type-system"; import type { FileStorageProvider } from "@local/hash-backend-utils/file-storage"; diff --git a/apps/hash-api/src/analysis/setup-analysis-handler/resolve-analysis.test.ts b/apps/hash-api/src/analysis/setup-analysis-handler/resolve-analysis.test.ts index cc25f5211a8..f1c07a7ea83 100644 --- a/apps/hash-api/src/analysis/setup-analysis-handler/resolve-analysis.test.ts +++ b/apps/hash-api/src/analysis/setup-analysis-handler/resolve-analysis.test.ts @@ -1,10 +1,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; -import type { - ActorEntityUuid, - RoleName, - WebId, -} from "@blockprotocol/type-system"; +import type { ActorEntityUuid, WebId } from "@blockprotocol/type-system"; import type { FileStorageProvider } from "@local/hash-backend-utils/file-storage"; import type Keyv from "keyv"; diff --git a/apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts b/apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts index d489f1ba2c8..a0d4f91ccff 100644 --- a/apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts +++ b/apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts @@ -14,7 +14,7 @@ import { } from "./kratos-endpoint-allowlist"; import type { Logger } from "@local/hash-backend-utils/logger"; -import type { NextFunction, Request, RequestHandler, Response } from "express"; +import type { Request, Response } from "express"; import type { AddressInfo } from "node:net"; vi.mock("@sentry/node", () => ({ captureMessage: vi.fn() })); diff --git a/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts b/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts index 0ead5948bef..12592e6915d 100644 --- a/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts +++ b/apps/hash-api/src/graph/knowledge/primitive/entity/before-update-entity-hooks/user-before-update-entity-hook-callback.ts @@ -33,11 +33,7 @@ import { import type { ImpureGraphContext } from "../../../../context-types"; import type { BeforeUpdateEntityHookCallback } from "../update-entity-hooks"; -import type { - ActorEntityUuid, - BaseUrl, - WebId, -} from "@blockprotocol/type-system"; +import type { ActorEntityUuid, BaseUrl } from "@blockprotocol/type-system"; import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user"; /** diff --git a/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts b/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts index da3ee5d2c19..19aee5d9201 100644 --- a/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts +++ b/apps/hash-api/src/graph/knowledge/system-types/user-secret.ts @@ -15,7 +15,6 @@ import type { MachineId, ProvidedEntityEditionProvenance, UserId, - WebId, } from "@blockprotocol/type-system"; import type { UserSecretService, diff --git a/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts b/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts index 0bf6d99520e..cfcd6ab6091 100644 --- a/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts +++ b/apps/hash-api/src/graphql/resolvers/knowledge/user/submit-early-access-form.ts @@ -10,7 +10,6 @@ import type { ResolverFn, } from "../../../api-types.gen"; import type { LoggedInGraphQLContext } from "../../../context"; -import type { WebId } from "@blockprotocol/type-system"; import type { ProspectiveUser } from "@local/hash-isomorphic-utils/system-types/prospectiveuser"; export const submitEarlyAccessFormResolver: ResolverFn< diff --git a/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts b/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts index 6df879592cc..33f0d259302 100644 --- a/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts +++ b/apps/hash-api/src/graphql/resolvers/ontology/entity-type.ts @@ -36,7 +36,6 @@ import type { GraphQLContext, LoggedInGraphQLContext } from "../../context"; import type { EntityTypeWithMetadata, OntologyTemporalMetadata, - WebId, } from "@blockprotocol/type-system"; import type { UserPermissionsOnEntityType } from "@local/hash-graph-sdk/authorization"; import type { diff --git a/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts b/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts index ad6c398a45e..fb30bb15456 100644 --- a/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts +++ b/apps/hash-api/src/graphql/resolvers/ontology/property-type.ts @@ -27,7 +27,6 @@ import type { GraphQLContext, LoggedInGraphQLContext } from "../../context"; import type { OntologyTemporalMetadata, PropertyTypeWithMetadata, - WebId, } from "@blockprotocol/type-system"; export const createPropertyTypeResolver: ResolverFn< diff --git a/apps/hash-api/src/integrations/google/oauth-callback.ts b/apps/hash-api/src/integrations/google/oauth-callback.ts index 413025ac636..298e5d9e3b5 100644 --- a/apps/hash-api/src/integrations/google/oauth-callback.ts +++ b/apps/hash-api/src/integrations/google/oauth-callback.ts @@ -12,7 +12,6 @@ import { createEntity } from "../../graph/knowledge/primitive/entity"; import { createUserSecret } from "../../graph/knowledge/system-types/user-secret"; import { enabledIntegrations } from "../enabled-integrations"; -import type { WebId } from "@blockprotocol/type-system"; import type { GoogleOAuth2CallbackRequest, GoogleOAuth2CallbackResponse, diff --git a/apps/hash-api/src/integrations/linear/oauth.ts b/apps/hash-api/src/integrations/linear/oauth.ts index 2842cf38901..74fecc17aab 100644 --- a/apps/hash-api/src/integrations/linear/oauth.ts +++ b/apps/hash-api/src/integrations/linear/oauth.ts @@ -25,7 +25,6 @@ import type { EntityId, EntityUuid, UserId, - WebId, } from "@blockprotocol/type-system"; import type { LinearIntegrationPropertiesWithMetadata } from "@local/hash-isomorphic-utils/system-types/linearintegration"; import type { RequestHandler } from "express"; diff --git a/apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts b/apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts index c8df6f7ef41..a4a32e697f3 100644 --- a/apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts +++ b/apps/hash-frontend/src/blocks/use-fetch-block-subgraph.ts @@ -17,14 +17,8 @@ import type { QueryEntitySubgraphQueryVariables, SubgraphAndPermissions as SubgraphAndPermissionsGQL, } from "../graphql/api-types.gen"; +import type { EntityRootType, Subgraph } from "@blockprotocol/graph"; import type { - EntityRootType, - KnowledgeGraphVertices, - Subgraph, -} from "@blockprotocol/graph"; -import type { - ActorEntityUuid, - EntityEditionId, EntityId, PropertyObject, VersionedUrl, @@ -65,8 +59,8 @@ export const useFetchBlockSubgraph = (): (( const placeholderEntity = new HashEntity({ metadata: { recordId: { - entityId: "placeholder-account~entity-id-not-set" as EntityId, - editionId: now as string as EntityEditionId, + entityId: "placeholder-account~entity-id-not-set", + editionId: now, }, entityTypeIds: blockEntityTypeIds, temporalVersioning: { @@ -92,13 +86,13 @@ export const useFetchBlockSubgraph = (): (( archived: false, provenance: { edition: { - createdById: "placeholder-account" as ActorEntityUuid, + createdById: "placeholder-account", actorType: "user", origin: { type: "web-app", }, }, - createdById: "placeholder-account" as ActorEntityUuid, + createdById: "placeholder-account", createdAtTransactionTime: now, createdAtDecisionTime: now, }, @@ -140,7 +134,7 @@ export const useFetchBlockSubgraph = (): (( inner: placeholderEntity, }, }, - } as KnowledgeGraphVertices, + }, temporalAxes: { initial: subgraphTemporalAxes, resolved: subgraphTemporalAxes, diff --git a/apps/hash-frontend/src/components/block-loader/block-loader.tsx b/apps/hash-frontend/src/components/block-loader/block-loader.tsx index 9a2c538ff70..148c848f675 100644 --- a/apps/hash-frontend/src/components/block-loader/block-loader.tsx +++ b/apps/hash-frontend/src/components/block-loader/block-loader.tsx @@ -33,7 +33,6 @@ import { RemoteBlock } from "../remote-block/remote-block"; import { fetchEmbedCode } from "./fetch-embed-code"; import type { - ArchiveEntityMessageCallback, CreateEntityMessageCallback, UpdateEntityMessageCallback, UploadFileRequestCallback, @@ -452,9 +451,7 @@ export const BlockLoader: FunctionComponent = ({ deleteEntity: async ( ...args: Parameters ) => { - const res = await deleteEntity( - args[0] as Parameters[0], - ); + const res = await deleteEntity(args[0]); await refetchSubgraph(); diff --git a/apps/hash-frontend/src/components/sandbox/framed-block/framed-block.tsx b/apps/hash-frontend/src/components/sandbox/framed-block/framed-block.tsx index e7bfb851d83..b29e488871b 100644 --- a/apps/hash-frontend/src/components/sandbox/framed-block/framed-block.tsx +++ b/apps/hash-frontend/src/components/sandbox/framed-block/framed-block.tsx @@ -29,10 +29,7 @@ export const FramedBlock: FunctionComponent = () => { const _beforeCapture = useCallback( (scope: Sentry.Scope) => { - scope.setTag( - "block", - blockProperties?.metadata.recordId.entityId as string, - ); + scope.setTag("block", blockProperties?.metadata.recordId.entityId); }, [blockProperties], ); diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/edge-document.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/edge-document.ts index af12347c844..62d2f422873 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/edge-document.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/edge-document.ts @@ -59,7 +59,7 @@ interface Head { } /** Reads the fields needed to interpret edge columns and the trailer. */ -const readHead = Result.fn(function* readHead( +const readHead = Result.fn(function* readEdgeHead( access: CborDecoder.CborMapAccess, ): Result.gen.Return { const partial: Partial> = {}; @@ -303,7 +303,7 @@ export interface DecodeOptions { } /** Assembles the envelope's edge columns with their decoded metadata. */ -const decodeDocument = Result.fn(function* decodeDocument< +const decodeDocument = Result.fn(function* decodeEdgeDocument< T extends ArrayBufferLike, >( decoder: Decoder.Decoder, diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/envelope.test.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/envelope.test.ts index 4b03b905be4..35f564688b5 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/envelope.test.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/envelope.test.ts @@ -123,10 +123,10 @@ describe("Envelope.decode success", () => { expect(positions.bytes?.[0]).toBe(0xfe); }); - it.each([ - { kind: "tile" as SaltileKind, magic: "SALTILET", minimum: 5 }, - { kind: "edges" as SaltileKind, magic: "SALTILEE", minimum: 4 }, - { kind: "locate" as SaltileKind, magic: "SALTILEL", minimum: 7 }, + it.each<{ readonly kind: SaltileKind; magic: string; minimum: number }>([ + { kind: "tile", magic: "SALTILET", minimum: 5 }, + { kind: "edges", magic: "SALTILEE", minimum: 4 }, + { kind: "locate", magic: "SALTILEL", minimum: 7 }, ])("decodes_$kind_at_minimum", ({ kind, magic, minimum }) => { const payloads: (number[] | null)[] = [ [0xa0], diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/envelope.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/envelope.ts index 1337aa0ed91..06a042695ad 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/envelope.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/envelope.ts @@ -115,7 +115,7 @@ export type DecodedEnvelope = readonly [ ]; /** Reads the common framing without interpreting individual payload contents. */ -const readEnvelope = Result.fn(function* readEnvelope< +const readEnvelope = Result.fn(function* readEnvelopeFields< T extends ArrayBufferLike, >( decoder: Decoder.Decoder, diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/iterable.test.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/iterable.test.ts index 37400250f97..c9304befffd 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/iterable.test.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/iterable.test.ts @@ -216,7 +216,7 @@ describe("Iterable", () => { }); it("zip_lazy", () => { - const first = vi.fn(function* first() { + const first = vi.fn(function* readFirst() { yield 1; yield 2; }); diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/locate-document.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/locate-document.ts index 9527f398295..1e35251a2f8 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/locate-document.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/locate-document.ts @@ -51,7 +51,7 @@ const checkCount = (field: string, expected: bigint) => ), ); -const decodeDocument = Result.fn(function* decodeDocument< +const decodeDocument = Result.fn(function* decodeLocateDocument< T extends ArrayBufferLike, >( decoder: Decoder.Decoder, diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/locate-document/head.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/locate-document/head.ts index 36c6178d4b3..5836796735f 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/locate-document/head.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/locate-document/head.ts @@ -53,7 +53,7 @@ const cellVisitor: CborDecoder.CborVisitor< }), }; -const readHead = Result.fn(function* readHead( +const readHead = Result.fn(function* readLocateHead( access: CborDecoder.CborMapAccess, ): Result.gen.Return< Head, diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/option.test.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/option.test.ts index 05cc0eec22c..bfae9b885a6 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/option.test.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/option.test.ts @@ -64,9 +64,7 @@ describe("Option", () => { expectTypeOf(Option.filter(isString)(option)).toEqualTypeOf< Option.Option >(); - expect(Option.filter(Option.some(1 as string | number), isString)).toEqual( - Option.none(), - ); + expect(Option.filter(Option.some(1), isString)).toEqual(Option.none()); }); it("lift_predicate_call_forms", () => { diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/result.composition.test.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/result.composition.test.ts index 4f49bf2902e..9a0994edf0f 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/result.composition.test.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/result.composition.test.ts @@ -129,7 +129,7 @@ describe("Result.All", () => { describe("Result.fn", () => { it("fresh_invocations", () => { const seen: number[] = []; - const increment = Result.fn(function* increment(value: number) { + const increment = Result.fn(function* incrementValue(value: number) { seen.push(value); return (yield* Result.ok(value)) + 1; }); @@ -140,7 +140,7 @@ describe("Result.fn", () => { }); it("generic_arguments", () => { - const identity = Result.fn(function* identity(value: T) { + const identity = Result.fn(function* yieldValue(value: T) { return yield* Result.ok(value); }); expectTypeOf(identity("text")).toEqualTypeOf>(); @@ -150,7 +150,7 @@ describe("Result.fn", () => { it("failed_step", () => { let continued = false; - const fail = Result.fn(function* fail() { + const fail = Result.fn(function* yieldFailure() { yield* Result.err("failed"); continued = true; return 1; diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document.ts index 1b55e54dbcf..999179340a8 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document.ts @@ -128,7 +128,7 @@ export interface DecodeOptions extends Head.Context { readonly detail: Detail.Detail; } -const decodeDocument = Result.fn(function* decodeDocument< +const decodeDocument = Result.fn(function* decodeTileDocument< T extends ArrayBufferLike, >( decoder: Decoder.Decoder, diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document/head.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document/head.ts index d8bc7859529..562d541e548 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document/head.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document/head.ts @@ -152,7 +152,7 @@ const boundsVisitor: CborDecoder.CborVisitor< }), }; -const readGlobal = Result.fn(function* readGlobal( +const readGlobal = Result.fn(function* readGlobalFields( access: CborDecoder.CborMapAccess, ): Result.gen.Return { const partial: Partial> = { bounds: null }; @@ -205,7 +205,7 @@ const globalVisitor: CborDecoder.CborVisitor< visitMap: readGlobal, }; -const readHead = Result.fn(function* readHead( +const readHead = Result.fn(function* readTileHead( access: CborDecoder.CborMapAccess, ): Result.gen.Return { const partial: Partial> = { global: null }; @@ -364,7 +364,7 @@ const checkGlobal = ( }; /** Reads metadata and validates the row partition and camera-framing metadata. */ -export const decode = Result.fn(function* decode( +export const decode = Result.fn(function* decodeTileHead( bytes: Uint8Array, ): Result.gen.Return { const head = yield* decodeHead(bytes); diff --git a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document/trailer.ts b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document/trailer.ts index 2c412bbc2aa..3ad3919e174 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document/trailer.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/atlas-decode/tile-document/trailer.ts @@ -13,7 +13,7 @@ export interface TileDocumentTrailer { readonly icons: readonly (string | null)[]; } -const readTrailer = Result.fn(function* readTrailer( +const readTrailer = Result.fn(function* readTrailerFields( access: CborDecoder.CborMapAccess, delivered: Num.u64, ): Result.gen.Return { diff --git a/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-edges-for-tiles.test.ts b/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-edges-for-tiles.test.ts index f21ff86bc0f..6b4dc181758 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-edges-for-tiles.test.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-edges-for-tiles.test.ts @@ -155,7 +155,7 @@ interface Captured { /** Stubs global fetch with canned routes, recording each path and JSON body. */ const stubTransport = (routes: Record Response>): Captured[] => { const captured: Captured[] = []; - vi.stubGlobal("fetch", ((url: string, init?: RequestInit) => { + vi.stubGlobal("fetch", (url: string, init?: RequestInit) => { const path = new URL(url, BASE).pathname; captured.push({ path, @@ -166,7 +166,7 @@ const stubTransport = (routes: Record Response>): Captured[] => { }); const route = routes[path]; return Promise.resolve(route === undefined ? notFound() : route()); - }) as typeof fetch); + }); return captured; }; diff --git a/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-locate.test.ts b/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-locate.test.ts index f02c7175214..c2633981645 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-locate.test.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-locate.test.ts @@ -32,8 +32,8 @@ import type { VersionedUrl } from "@blockprotocol/type-system"; const BASE = "http://api.test/atlas"; const COLORED_TYPES: readonly VersionedUrl[] = [ - "https://t.test/person/v/3" as VersionedUrl, - "https://t.test/authored/v/1" as VersionedUrl, + "https://t.test/person/v/3", + "https://t.test/authored/v/1", ]; const genHex = (byte: number): string => @@ -132,7 +132,7 @@ const stubAuthorityTransport = ( >, ): RecordedRequest[] => { const seen: RecordedRequest[] = []; - vi.stubGlobal("fetch", ((url: string, init?: RequestInit) => { + vi.stubGlobal("fetch", (url: string, init?: RequestInit) => { const request: RecordedRequest = { path: new URL(url, BASE).pathname, authority: new Headers(init?.headers).get(ATLAS_AUTHORITY_HEADER), @@ -144,7 +144,7 @@ const stubAuthorityTransport = ( seen.push(request); const route = routes[request.path]; return Promise.resolve(route === undefined ? notFound() : route(request)); - }) as typeof fetch); + }); return seen; }; diff --git a/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-tile.test.ts b/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-tile.test.ts index 51c0463b2e7..c3cf9f0712c 100644 --- a/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-tile.test.ts +++ b/apps/hash-frontend/src/components/tiled-network-graph/tiling/fetch-tile.test.ts @@ -402,12 +402,12 @@ const unauthorized = (): Response => /** Stubs the global fetch with canned routes and records every path hit. */ const stubTransport = (routes: Record Response>): string[] => { const paths: string[] = []; - vi.stubGlobal("fetch", ((url: string) => { + vi.stubGlobal("fetch", (url: string) => { const path = new URL(url, BASE).pathname; paths.push(path); const route = routes[path]; return Promise.resolve(route === undefined ? notFound() : route()); - }) as typeof fetch); + }); return paths; }; @@ -698,7 +698,7 @@ describe("fetchTile", () => { it("requests the detail trailer and attaches per-point labels", async () => { const generation = genHex(0x66); const bodies: (string | undefined)[] = []; - vi.stubGlobal("fetch", ((url: string, init?: RequestInit) => { + vi.stubGlobal("fetch", (url: string, init?: RequestInit) => { const path = new URL(url, BASE).pathname; if (path.includes("/atlas/tile/")) { bodies.push(typeof init?.body === "string" ? init.body : undefined); @@ -711,7 +711,7 @@ describe("fetchTile", () => { return Promise.resolve(manifest(generation)); } return Promise.resolve(notFound()); - }) as typeof fetch); + }); const { nodes } = await fetchTile(u64(3), u64(13), { baseUrl: BASE, @@ -732,7 +732,7 @@ describe("fetchTile", () => { it("sends coloredTypeIds and decodes the per-point type mask", async () => { const generation = genHex(0x77); const bodies: (string | undefined)[] = []; - vi.stubGlobal("fetch", ((url: string, init?: RequestInit) => { + vi.stubGlobal("fetch", (url: string, init?: RequestInit) => { const path = new URL(url, BASE).pathname; if (path.includes("/atlas/tile/")) { bodies.push(typeof init?.body === "string" ? init.body : undefined); @@ -745,7 +745,7 @@ describe("fetchTile", () => { return Promise.resolve(manifest(generation)); } return Promise.resolve(notFound()); - }) as typeof fetch); + }); const { nodes } = await fetchTile(u64(3), u64(13), { baseUrl: BASE, @@ -825,11 +825,11 @@ describe("the atlas base", () => { saltile(tileBytes(0x99, 3, 5, 1)), }; const credentials: (RequestCredentials | undefined)[] = []; - vi.stubGlobal("fetch", ((url: string, init?: RequestInit) => { + vi.stubGlobal("fetch", (url: string, init?: RequestInit) => { credentials.push(init?.credentials); const route = routes[new URL(url, BASE).pathname]; return Promise.resolve(route === undefined ? notFound() : route()); - }) as typeof fetch); + }); await fetchTile(u64(3), u64(13), { baseUrl: BASE }); @@ -971,7 +971,7 @@ const stubAuthorityTransport = ( >, ): RecordedRequest[] => { const seen: RecordedRequest[] = []; - vi.stubGlobal("fetch", ((url: string, init?: RequestInit) => { + vi.stubGlobal("fetch", (url: string, init?: RequestInit) => { const request: RecordedRequest = { path: new URL(url, BASE).pathname, method: init?.method ?? "GET", @@ -982,7 +982,7 @@ const stubAuthorityTransport = ( seen.push(request); const route = routes[request.path]; return Promise.resolve(route === undefined ? notFound() : route(request)); - }) as typeof fetch); + }); return seen; }; diff --git a/apps/hash-frontend/src/lib/user-and-org.ts b/apps/hash-frontend/src/lib/user-and-org.ts index 7107fac6380..4d8e5eed894 100644 --- a/apps/hash-frontend/src/lib/user-and-org.ts +++ b/apps/hash-frontend/src/lib/user-and-org.ts @@ -223,7 +223,7 @@ export const constructOrg = (params: { ) { hasBio = { linkEntity: linkEntityRevision, - profileBioEntity: rightEntityRevision as HashEntity, + profileBioEntity: rightEntityRevision, }; continue; } diff --git a/apps/hash-frontend/src/pages/@/[shortname].page/edit-pinned-entity-types-modal.tsx b/apps/hash-frontend/src/pages/@/[shortname].page/edit-pinned-entity-types-modal.tsx index 62d61bfd9fe..9397a4db4c1 100644 --- a/apps/hash-frontend/src/pages/@/[shortname].page/edit-pinned-entity-types-modal.tsx +++ b/apps/hash-frontend/src/pages/@/[shortname].page/edit-pinned-entity-types-modal.tsx @@ -35,7 +35,7 @@ import type { UpdateEntityMutationVariables, } from "../../../graphql/api-types.gen"; import type { Org, User } from "../../../lib/user-and-org"; -import type { EntityTypeWithMetadata, WebId } from "@blockprotocol/type-system"; +import type { EntityTypeWithMetadata } from "@blockprotocol/type-system"; import type { ModalProps } from "@mui/material"; import type { FunctionComponent, ReactElement } from "react"; import type { @@ -102,7 +102,7 @@ export const EditPinnedEntityTypesModal: FunctionComponent< >(updateEntityMutation, { errorPolicy: "all" }); const { createEntityType } = useBlockProtocolCreateEntityType( - authenticatedUser.accountId as WebId, + authenticatedUser.accountId, ); const { control, reset, handleSubmit, formState } = diff --git a/apps/hash-frontend/src/pages/@/[shortname].page/edit-user-profile-info-modal/user-profile-info-form.tsx b/apps/hash-frontend/src/pages/@/[shortname].page/edit-user-profile-info-modal/user-profile-info-form.tsx index 90567b7afcf..bbda178f020 100644 --- a/apps/hash-frontend/src/pages/@/[shortname].page/edit-user-profile-info-modal/user-profile-info-form.tsx +++ b/apps/hash-frontend/src/pages/@/[shortname].page/edit-user-profile-info-modal/user-profile-info-form.tsx @@ -28,7 +28,6 @@ import type { User, UserServiceAccount, } from "../../../../lib/user-and-org"; -import type { WebId } from "@blockprotocol/type-system"; import type { HashEntity, HashLinkEntity } from "@local/hash-graph-sdk/entity"; import type { ProfileURLPropertyValueWithMetadata } from "@local/hash-isomorphic-utils/system-types/shared"; import type { FunctionComponent } from "react"; @@ -57,9 +56,7 @@ export const UserProfileInfoForm: FunctionComponent<{ const [updateUser] = useUpdateAuthenticatedUser(); const { archiveEntity } = useBlockProtocolArchiveEntity(); - const { createEntity } = useBlockProtocolCreateEntity( - userProfile.accountId as WebId, - ); + const { createEntity } = useBlockProtocolCreateEntity(userProfile.accountId); const [updateEntity] = useMutation< UpdateEntityMutation, diff --git a/apps/hash-frontend/src/pages/@/[shortname].page/edit-user-profile-info-modal/user-profile-info-modal-header.tsx b/apps/hash-frontend/src/pages/@/[shortname].page/edit-user-profile-info-modal/user-profile-info-modal-header.tsx index 46c1d6118ee..3f06971ffea 100644 --- a/apps/hash-frontend/src/pages/@/[shortname].page/edit-user-profile-info-modal/user-profile-info-modal-header.tsx +++ b/apps/hash-frontend/src/pages/@/[shortname].page/edit-user-profile-info-modal/user-profile-info-modal-header.tsx @@ -15,7 +15,6 @@ import { useUpdateProfileAvatar } from "../../[shortname]/shared/use-update-prof import { leftColumnWidth } from "../util"; import type { User } from "../../../../lib/user-and-org"; -import type { WebId } from "@blockprotocol/type-system"; import type { ChangeEventHandler, FunctionComponent } from "react"; // const AvatarButton = styled((props: ButtonProps) => ( @@ -137,7 +136,7 @@ export const UserProfileInfoModalHeader: FunctionComponent<{ // setNewCoverImageUploading(true); await uploadFile({ - webId: userProfile.accountId as WebId, + webId: userProfile.accountId, makePublic: true, fileData: { description: `The cover image for the ${userProfile.displayName} user in HASH`, diff --git a/apps/hash-frontend/src/pages/@/[shortname].page/pinned-entity-type-tab-contents.tsx b/apps/hash-frontend/src/pages/@/[shortname].page/pinned-entity-type-tab-contents.tsx index 4ab6d0bf96b..8c3e9b26666 100644 --- a/apps/hash-frontend/src/pages/@/[shortname].page/pinned-entity-type-tab-contents.tsx +++ b/apps/hash-frontend/src/pages/@/[shortname].page/pinned-entity-type-tab-contents.tsx @@ -37,7 +37,7 @@ import { ProfileSectionHeading } from "../[shortname]/shared/profile-section-hea import type { Org, User } from "../../../lib/user-and-org"; import type { ProfilePageTab } from "./util"; import type { EntityRootType, Subgraph } from "@blockprotocol/graph"; -import type { EntityTypeWithMetadata, WebId } from "@blockprotocol/type-system"; +import type { EntityTypeWithMetadata } from "@blockprotocol/type-system"; import type { HashEntity } from "@local/hash-graph-sdk/entity"; import type { FunctionComponent } from "react"; @@ -139,9 +139,7 @@ export const PinnedEntityTypeTabContents: FunctionComponent<{ const [sortOrder, setSortOrder] = useState("updated-at-desc"); - const webId = ( - profile.kind === "user" ? profile.accountId : profile.webId - ) as WebId; + const webId = profile.kind === "user" ? profile.accountId : profile.webId; const { lastRootPageIndex } = useAccountPages(webId); const [createUntitledPage] = useCreatePage({ diff --git a/apps/hash-frontend/src/pages/@/[shortname]/shared/flow-visualizer/activity-log.tsx b/apps/hash-frontend/src/pages/@/[shortname]/shared/flow-visualizer/activity-log.tsx index 9db6df1ac84..42529d8c4ea 100644 --- a/apps/hash-frontend/src/pages/@/[shortname]/shared/flow-visualizer/activity-log.tsx +++ b/apps/hash-frontend/src/pages/@/[shortname]/shared/flow-visualizer/activity-log.tsx @@ -50,7 +50,6 @@ import type { EntityRootType } from "@blockprotocol/graph"; import type { EntityEditionId, EntityId, - EntityMetadata, EntityRecordId, } from "@blockprotocol/type-system"; import type { Filter } from "@local/hash-graph-client"; @@ -101,7 +100,7 @@ const getEntityLabelFromLog = ( entityId: proposedEntity.localEntityId, } satisfies EntityRecordId, entityTypeIds: proposedEntity.entityTypeIds, - } as EntityMetadata, + }, }, true, ); diff --git a/apps/hash-frontend/src/pages/@/[shortname]/shared/flow-visualizer/outputs/entity-result-table.tsx b/apps/hash-frontend/src/pages/@/[shortname]/shared/flow-visualizer/outputs/entity-result-table.tsx index 6f1cd2cb12e..77dca44465c 100644 --- a/apps/hash-frontend/src/pages/@/[shortname]/shared/flow-visualizer/outputs/entity-result-table.tsx +++ b/apps/hash-frontend/src/pages/@/[shortname]/shared/flow-visualizer/outputs/entity-result-table.tsx @@ -511,6 +511,7 @@ export const EntityResultTable = memo( relevance: { header: "Relevance", initialValue: "All", + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- required so that type narrowing below on initialValue works options: { All: { count: 0, @@ -523,18 +524,21 @@ export const EntityResultTable = memo( status: { header: "Status", initialValue: new Set(), + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- required so that type narrowing below on initialValue works options: {} as VirtualizedTableFilterDefinition["options"], type: "checkboxes", }, entityTypeIds: { header: "Type", initialValue: new Set(), + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- required so that type narrowing below on initialValue works options: {} as VirtualizedTableFilterDefinition["options"], type: "checkboxes", }, entityLabel: { header: "Name", initialValue: new Set(), + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- required so that type narrowing below on initialValue works options: {} as VirtualizedTableFilterDefinition["options"], type: "checkboxes", }, diff --git a/apps/hash-frontend/src/pages/@/[shortname]/types/data-type/[...slug-maybe-version].page.test.tsx b/apps/hash-frontend/src/pages/@/[shortname]/types/data-type/[...slug-maybe-version].page.test.tsx index aa7b87eff36..dffd2d550e0 100644 --- a/apps/hash-frontend/src/pages/@/[shortname]/types/data-type/[...slug-maybe-version].page.test.tsx +++ b/apps/hash-frontend/src/pages/@/[shortname]/types/data-type/[...slug-maybe-version].page.test.tsx @@ -4,7 +4,7 @@ import { describe, expect, test, vi } from "vitest"; import Page from "./[...slug-maybe-version].page"; const router = vi.hoisted(() => ({ - query: {} as Record, + query: {}, asPath: "", })); diff --git a/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-filters.tsx b/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-filters.tsx index ffcde3a3495..4963a82fd7f 100644 --- a/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-filters.tsx +++ b/apps/hash-frontend/src/pages/actions.page/draft-entities/draft-entities-filters.tsx @@ -316,9 +316,7 @@ export const DraftEntitiesFilters: FunctionComponent<{ }, ) .map(({ web, label }) => { - const webWebId = ( - web.kind === "user" ? web.accountId : web.webId - ) as WebId; + const webWebId = web.kind === "user" ? web.accountId : web.webId; return { icon: web.kind === "user" ? : , label, diff --git a/apps/hash-frontend/src/pages/dashboard/[dashboard-id].page/dashboard-grid/dashboard-item/dashboard-item-content/world-map-renderer.tsx b/apps/hash-frontend/src/pages/dashboard/[dashboard-id].page/dashboard-grid/dashboard-item/dashboard-item-content/world-map-renderer.tsx index b933eae87b8..27b7349e99f 100644 --- a/apps/hash-frontend/src/pages/dashboard/[dashboard-id].page/dashboard-grid/dashboard-item/dashboard-item-content/world-map-renderer.tsx +++ b/apps/hash-frontend/src/pages/dashboard/[dashboard-id].page/dashboard-grid/dashboard-item/dashboard-item-content/world-map-renderer.tsx @@ -389,7 +389,7 @@ export const WorldMapRenderer = ({ zlevel: 1, }, ], - } as ECOption; + }; }, [flights, isMapReady]); if (!isMapReady) { diff --git a/apps/hash-frontend/src/pages/dashboard/[dashboard-id].page/item-config-modal/structural-query-builder.tsx b/apps/hash-frontend/src/pages/dashboard/[dashboard-id].page/item-config-modal/structural-query-builder.tsx index b07c8cc7093..9486a85f0a1 100644 --- a/apps/hash-frontend/src/pages/dashboard/[dashboard-id].page/item-config-modal/structural-query-builder.tsx +++ b/apps/hash-frontend/src/pages/dashboard/[dashboard-id].page/item-config-modal/structural-query-builder.tsx @@ -253,10 +253,9 @@ const parseCondition = (filter: Filter): ParsedCondition => { }; }; -const buildEntityTypeCondition = (entityTypeBaseUrl: string): Filter => - ({ - equal: [{ path: ["type", "baseUrl"] }, { parameter: entityTypeBaseUrl }], - }) as unknown as Filter; +const buildEntityTypeCondition = (entityTypeBaseUrl: string): Filter => ({ + equal: [{ path: ["type", "baseUrl"] }, { parameter: entityTypeBaseUrl }], +}); const buildPropertyCondition = ({ propertyBaseUrl, @@ -272,13 +271,13 @@ const buildPropertyCondition = ({ const path = ["properties", propertyBaseUrl]; switch (operator) { case "hasAnyValue": - return { exists: { path } } as unknown as Filter; + return { exists: { path } }; case "isEmpty": - return { not: { exists: { path } } } as unknown as Filter; + return { not: { exists: { path } } }; case "isTrue": - return { equal: [{ path }, { parameter: true }] } as unknown as Filter; + return { equal: [{ path }, { parameter: true }] }; case "isFalse": - return { equal: [{ path }, { parameter: false }] } as unknown as Filter; + return { equal: [{ path }, { parameter: false }] }; default: { let parameter: unknown = value; if (kind === "number") { @@ -286,7 +285,7 @@ const buildPropertyCondition = ({ parameter = value.trim() !== "" && !Number.isNaN(numeric) ? numeric : value; } - return { [operator]: [{ path }, { parameter }] } as unknown as Filter; + return { [operator]: [{ path }, { parameter }] }; } } }; @@ -342,7 +341,7 @@ const useBuilderOptions = (): BuilderOptions => { !isSpecialEntityTypeLookup?.[entityType.schema.$id]?.isLink, ) .map((entityType) => ({ - value: entityType.metadata.recordId.baseUrl as string, + value: entityType.metadata.recordId.baseUrl, text: entityType.schema.title, })) .sort((a, b) => a.text.localeCompare(b.text)), @@ -543,7 +542,7 @@ const ExpressionEditor = ({ expression, onChange }: ExpressionEditorProps) => { onChange={(newValue) => onChange({ parameter: parseParameterInput(newValue), - } as FilterExpression) + }) } /> )} @@ -602,14 +601,14 @@ const AdvancedConditionEditor = ({ const { path } = (filter as { exists: { path: unknown[] } }).exists; onChange({ [newOperator]: [{ path }, { parameter: "" }], - } as unknown as Filter); + }); return; } const operands = (filter as unknown as Record)[ operator ]; - onChange({ [newOperator]: operands } as unknown as Filter); + onChange({ [newOperator]: operands }); }; const operatorSelect = ( @@ -655,7 +654,7 @@ const AdvancedConditionEditor = ({ const updateOperand = (index: 0 | 1, expression: FilterExpression) => { const newOperands: FilterExpression[] = [...operands]; newOperands[index] = expression; - onChange({ [operator]: newOperands } as unknown as Filter); + onChange({ [operator]: newOperands }); }; return ( @@ -957,20 +956,20 @@ const FilterNodeEditor = ({ groupKind === "not" ? [] : (filter as unknown as Record<"all" | "any", Filter[]>)[groupKind]; - onChange({ not: children[0] ?? defaultCondition } as Filter); + onChange({ not: children[0] ?? defaultCondition }); return; } if (groupKind === "not") { onChange({ [newKind]: [(filter as { not: Filter }).not], - } as unknown as Filter); + }); return; } onChange({ [newKind]: (filter as unknown as Record<"all" | "any", Filter[]>)[ groupKind ], - } as unknown as Filter); + }); }; const header = ( @@ -1012,7 +1011,7 @@ const FilterNodeEditor = ({ filter={child} depth={depth + 1} options={options} - onChange={(newChild) => onChange({ not: newChild } as Filter)} + onChange={(newChild) => onChange({ not: newChild })} /> @@ -1026,7 +1025,7 @@ const FilterNodeEditor = ({ const updateChild = (index: number, child: Filter) => { const newChildren = [...children]; newChildren[index] = child; - onChange({ [groupKind]: newChildren } as unknown as Filter); + onChange({ [groupKind]: newChildren }); }; return ( @@ -1046,7 +1045,7 @@ const FilterNodeEditor = ({ [groupKind]: children.filter( (_, childIndex) => childIndex !== index, ), - } as unknown as Filter) + }) } /> ))} @@ -1059,7 +1058,7 @@ const FilterNodeEditor = ({ onClick={() => onChange({ [groupKind]: [...children, defaultCondition], - } as unknown as Filter) + }) } > Condition @@ -1072,7 +1071,7 @@ const FilterNodeEditor = ({ onClick={() => onChange({ [groupKind]: [...children, { all: [defaultCondition] }], - } as unknown as Filter) + }) } > Group @@ -1279,8 +1278,7 @@ const useRelationshipOptions = ( { direction: "incoming", linkTypeBaseUrl, - entityTypeBaseUrl: candidateType.metadata.recordId - .baseUrl as string, + entityTypeBaseUrl: candidateType.metadata.recordId.baseUrl, }, ); } diff --git a/apps/hash-frontend/src/pages/dashboard/hooks/use-dashboard-item-config.ts b/apps/hash-frontend/src/pages/dashboard/hooks/use-dashboard-item-config.ts index d40b08fed7c..a5867df5ce6 100644 --- a/apps/hash-frontend/src/pages/dashboard/hooks/use-dashboard-item-config.ts +++ b/apps/hash-frontend/src/pages/dashboard/hooks/use-dashboard-item-config.ts @@ -344,7 +344,7 @@ export const useDashboardItemConfig = ({ "https://blockprotocol.org/@blockprotocol/types/data-type/object/v/1", }, }, - } as PropertyPatchOperation); + }); } // Set status to ready diff --git a/apps/hash-frontend/src/pages/dashboard/hooks/use-dashboard-item-generations.ts b/apps/hash-frontend/src/pages/dashboard/hooks/use-dashboard-item-generations.ts index e7d7673da83..d913290fcd8 100644 --- a/apps/hash-frontend/src/pages/dashboard/hooks/use-dashboard-item-generations.ts +++ b/apps/hash-frontend/src/pages/dashboard/hooks/use-dashboard-item-generations.ts @@ -304,7 +304,7 @@ export const useDashboardItemGenerations = ({ "https://blockprotocol.org/@blockprotocol/types/data-type/object/v/1", }, }, - } as PropertyPatchOperation); + }); } propertyPatches.push({ op: "replace", diff --git a/apps/hash-frontend/src/pages/index.page/waitlisted/early-access-modal.tsx b/apps/hash-frontend/src/pages/index.page/waitlisted/early-access-modal.tsx index 294395f3ccb..deea0a7b3f5 100644 --- a/apps/hash-frontend/src/pages/index.page/waitlisted/early-access-modal.tsx +++ b/apps/hash-frontend/src/pages/index.page/waitlisted/early-access-modal.tsx @@ -181,9 +181,8 @@ export const EarlyAccessFormModal = ({ event.preventDefault(); try { - void new URL( - formState["https://hash.ai/@h/types/property-type/website-url/"], - ); + // eslint-disable-next-line no-new -- URL validation throws on invalid input. + new URL(formState["https://hash.ai/@h/types/property-type/website-url/"]); } catch { setUrlError("Please enter a valid URL."); return; diff --git a/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx b/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx index 806d34fc29a..80c96466cb2 100644 --- a/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx +++ b/apps/hash-frontend/src/pages/notes.page/convert-quick-note-to-page-modal.tsx @@ -28,7 +28,7 @@ import type { UpdateEntityMutation, UpdateEntityMutationVariables, } from "../../graphql/api-types.gen"; -import type { BaseUrl, WebId } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@blockprotocol/type-system"; import type { FractionalIndexPropertyValueWithMetadata, PageProperties, @@ -65,7 +65,7 @@ export const ConvertQuickNoteToPageModal: FunctionComponent< const defaultTitle = `Quick Note - ${createdAt.toLocaleString()}`; - const { data: pages } = useAccountPages(authenticatedUser.accountId as WebId); + const { data: pages } = useAccountPages(authenticatedUser.accountId); const [updateEntity] = useMutation< UpdateEntityMutation, @@ -73,7 +73,7 @@ export const ConvertQuickNoteToPageModal: FunctionComponent< >(updateEntityMutation); const { createEntity } = useBlockProtocolCreateEntity( - authenticatedUser.accountId as WebId, + authenticatedUser.accountId, ); const innerSubmit = handleSubmit(async (data) => { diff --git a/apps/hash-frontend/src/pages/notes.page/create-quick-note.tsx b/apps/hash-frontend/src/pages/notes.page/create-quick-note.tsx index 495681b54a6..2e8d87ee5f7 100644 --- a/apps/hash-frontend/src/pages/notes.page/create-quick-note.tsx +++ b/apps/hash-frontend/src/pages/notes.page/create-quick-note.tsx @@ -15,7 +15,6 @@ import { useCreateBlockCollection } from "../shared/use-create-block-collection" import { EditableQuickNote } from "./editable-quick-note"; import type { EntityRootType, Subgraph } from "@blockprotocol/graph"; -import type { WebId } from "@blockprotocol/type-system"; import type { HashEntity } from "@local/hash-graph-sdk/entity"; import type { FunctionComponent } from "react"; @@ -67,7 +66,7 @@ export const CreateQuickNote: FunctionComponent<{ } const { createBlockCollectionEntity } = useCreateBlockCollection({ - webId: authenticatedUser.accountId as WebId, + webId: authenticatedUser.accountId, }); const { getEntity } = useBlockProtocolGetEntity(); diff --git a/apps/hash-frontend/src/pages/notes.page/editable-quick-note.tsx b/apps/hash-frontend/src/pages/notes.page/editable-quick-note.tsx index da6090f62a0..cc5d3106e19 100644 --- a/apps/hash-frontend/src/pages/notes.page/editable-quick-note.tsx +++ b/apps/hash-frontend/src/pages/notes.page/editable-quick-note.tsx @@ -47,7 +47,7 @@ import type { } from "../../graphql/api-types.gen"; import type { PageWithParentLink } from "./convert-quick-note-to-page-modal"; import type { EntityRootType, Subgraph } from "@blockprotocol/graph"; -import type { BaseUrl, WebId } from "@blockprotocol/type-system"; +import type { BaseUrl } from "@blockprotocol/type-system"; import type { BlockCollectionContentItem } from "@local/hash-isomorphic-utils/entity"; import type { ArchivedPropertyValueWithMetadata, @@ -124,7 +124,7 @@ export const EditableQuickNote: FunctionComponent<{ useState(false); const { refetch: refetchPageTree } = useAccountPages( - authenticatedUser.accountId as WebId, + authenticatedUser.accountId, ); const blockCollectionEntityId = quickNoteEntity.metadata.recordId.entityId; @@ -407,7 +407,7 @@ export const EditableQuickNote: FunctionComponent<{ {contents && contents.length > 0 ? ( = ({ const configProperties = extractConfigPropertySchemas(blockSchema ?? {}); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: schema keys are plain strings. const entityData = blockEntity?.blockChildEntity.properties as | JsonObject | undefined; diff --git a/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/block-select-data-modal.tsx b/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/block-select-data-modal.tsx index 46f61a6a54f..16cad2e5e1c 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/block-select-data-modal.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/block-select-data-modal.tsx @@ -31,7 +31,6 @@ import type { BaseUrl, EntityId, PropertyObject, - WebId, } from "@blockprotocol/type-system"; import type { ModalProps } from "@hashintel/design-system"; import type { HashEntity } from "@local/hash-graph-sdk/entity"; @@ -121,7 +120,7 @@ export const BlockSelectDataModal: FunctionComponent< const { authenticatedUser } = useAuthenticatedUser(); const { createEntity } = useBlockProtocolCreateEntity( - authenticatedUser.accountId as WebId, + authenticatedUser.accountId, ); const [updateEntity] = useMutation< diff --git a/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/load-entity-menu-content.tsx b/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/load-entity-menu-content.tsx index 0cfa10534bb..2d11ff6e4d8 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/load-entity-menu-content.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/block-context-menu/load-entity-menu-content.tsx @@ -34,7 +34,6 @@ import type { QueryEntitySubgraphQueryVariables, } from "../../../../graphql/api-types.gen"; import type { EntityId, VersionedUrl } from "@blockprotocol/type-system"; -import type { EntityStoreType } from "@local/hash-isomorphic-utils/entity-store"; import type { PopupState } from "material-ui-popup-state/hooks"; import type { FunctionComponent } from "react"; @@ -105,10 +104,7 @@ export const LoadEntityMenuContent: FunctionComponent< * @todo properly type this part of the DraftEntity type * @see https://linear.app/hash/issue/H-3000 */ - blockView.manager.replaceBlockChildEntity( - blockEntityId, - targetEntity as EntityStoreType, - ); + blockView.manager.replaceBlockChildEntity(blockEntityId, targetEntity); }, [blockView, blockEntityId], ); diff --git a/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-text-field.tsx b/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-text-field.tsx index c587ff4f37b..6897dfb030d 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-text-field.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/comments/comment-text-field.tsx @@ -35,7 +35,6 @@ import { } from "./comment-placeholder-plugin"; import styles from "./style.module.css"; -import type { CommentPlaceholderAction } from "./comment-placeholder-plugin"; import type { TextToken } from "@local/hash-isomorphic-utils/types"; import type { EditorView } from "prosemirror-view"; import type { FunctionComponent } from "react"; @@ -216,7 +215,7 @@ export const CommentTextField: FunctionComponent = ({ const tr = view.state.tr.setMeta(commentPlaceholderPluginkey, { type: "replacePlaceholder", payload: { placeholder }, - } as CommentPlaceholderAction); + }); view.dispatch(tr); } }, [placeholder]); diff --git a/apps/hash-frontend/src/pages/shared/block-collection/component-view.tsx b/apps/hash-frontend/src/pages/shared/block-collection/component-view.tsx index 15cef352cda..fbc8b224fb0 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/component-view.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/component-view.tsx @@ -25,7 +25,6 @@ import { BlockContext } from "./block-context"; import { suggesterPluginKey } from "./create-suggester/create-suggester"; import type { RenderPortal } from "./block-portals"; -import type { SuggesterAction } from "./create-suggester/create-suggester"; import type { EntityId, VersionedUrl } from "@blockprotocol/type-system"; import type { HashBlock } from "@local/hash-isomorphic-utils/blocks"; import type { BlockEntity } from "@local/hash-isomorphic-utils/entity"; @@ -138,7 +137,7 @@ export class ComponentView implements NodeView { this.editorView.state.tr.setMeta(suggesterPluginKey, { type: "suggestedBlock", payload: { position: null }, - } as SuggesterAction), + }), ); } diff --git a/apps/hash-frontend/src/pages/shared/block-collection/create-suggester/create-suggester.tsx b/apps/hash-frontend/src/pages/shared/block-collection/create-suggester/create-suggester.tsx index da5a70cabc0..d0f4f42f86b 100644 --- a/apps/hash-frontend/src/pages/shared/block-collection/create-suggester/create-suggester.tsx +++ b/apps/hash-frontend/src/pages/shared/block-collection/create-suggester/create-suggester.tsx @@ -332,7 +332,7 @@ export const createSuggester = ( tr.setMeta(suggesterPluginKey, { type: "suggestedBlock", payload: { position: componentPosition }, - } as SuggesterAction); + }); view.dispatch(tr); }) diff --git a/apps/hash-frontend/src/pages/shared/claims-table.tsx b/apps/hash-frontend/src/pages/shared/claims-table.tsx index 5440fe15669..d19258ea0fe 100644 --- a/apps/hash-frontend/src/pages/shared/claims-table.tsx +++ b/apps/hash-frontend/src/pages/shared/claims-table.tsx @@ -338,18 +338,21 @@ export const ClaimsTable = memo( status: { header: "Status", initialValue: new Set(), + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- required so that type narrowing below on initialValue works options: {} as VirtualizedTableFilterDefinition["options"], type: "checkboxes", }, subject: { header: "Subject", initialValue: new Set(), + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- required so that type narrowing below on initialValue works options: {} as VirtualizedTableFilterDefinition["options"], type: "checkboxes", }, object: { header: "Relevant value", initialValue: new Set(), + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- required so that type narrowing below on initialValue works options: {} as VirtualizedTableFilterDefinition["options"], type: "checkboxes", }, diff --git a/apps/hash-frontend/src/pages/shared/data-type/data-type-constraints/shared/enum-editor.tsx b/apps/hash-frontend/src/pages/shared/data-type/data-type-constraints/shared/enum-editor.tsx index 2845511be67..afddf6db9bd 100644 --- a/apps/hash-frontend/src/pages/shared/data-type/data-type-constraints/shared/enum-editor.tsx +++ b/apps/hash-frontend/src/pages/shared/data-type/data-type-constraints/shared/enum-editor.tsx @@ -528,7 +528,8 @@ export const EnumEditor = ({ } if (mergedSchema.format === "uri") { try { - void new URL(value); + // eslint-disable-next-line no-new -- URL validation throws on invalid input. + new URL(value); } catch { setError(`constraints.enum.${index}`, { message: "Value must be a valid URL", diff --git a/apps/hash-frontend/src/pages/shared/entities-visualizer/entities-table.tsx b/apps/hash-frontend/src/pages/shared/entities-visualizer/entities-table.tsx index 5ae354e5b02..4666d8ef8f9 100644 --- a/apps/hash-frontend/src/pages/shared/entities-visualizer/entities-table.tsx +++ b/apps/hash-frontend/src/pages/shared/entities-visualizer/entities-table.tsx @@ -540,7 +540,7 @@ export const EntitiesTable: FunctionComponent<{ columnId === "sourceEntity" || columnId === "targetEntity" ) { - const entity = row[columnId] as EntitiesTableRow["sourceEntity"]; + const entity = row[columnId]; if (!entity) { const data = "Does not apply"; return { diff --git a/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/displays-files-only.test.ts b/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/displays-files-only.test.ts index ee2e76f6b33..11037d68f0e 100644 --- a/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/displays-files-only.test.ts +++ b/apps/hash-frontend/src/pages/shared/entities-visualizer/shared/displays-files-only.test.ts @@ -29,7 +29,7 @@ const lookup = ( typeId, { isFile, isImage: false, isLink: false }, ]), - ) as Record; + ); const fileLookup = lookup({ [fileTypeId]: true, diff --git a/apps/hash-frontend/src/pages/shared/entities-visualizer/use-entities-table-query/generate-table-data-from-endpoint-rows.browser.test.ts b/apps/hash-frontend/src/pages/shared/entities-visualizer/use-entities-table-query/generate-table-data-from-endpoint-rows.browser.test.ts index 9257d0d9e1c..b157d1117fa 100644 --- a/apps/hash-frontend/src/pages/shared/entities-visualizer/use-entities-table-query/generate-table-data-from-endpoint-rows.browser.test.ts +++ b/apps/hash-frontend/src/pages/shared/entities-visualizer/use-entities-table-query/generate-table-data-from-endpoint-rows.browser.test.ts @@ -215,7 +215,7 @@ describe("generateTableDataFromEndpointRows", () => { definitions: { ...definitions, propertyTypes: {}, - } as unknown as EntityTypeResolveDefinitions, + }, endpointRows: [row("1", { name: "Alice" })], }), ).toThrow(/Property type not found/); diff --git a/apps/hash-frontend/src/pages/shared/entity-type-page/edit-bar-type-editor.test.tsx b/apps/hash-frontend/src/pages/shared/entity-type-page/edit-bar-type-editor.test.tsx index 18e469f816e..382ee439757 100644 --- a/apps/hash-frontend/src/pages/shared/entity-type-page/edit-bar-type-editor.test.tsx +++ b/apps/hash-frontend/src/pages/shared/entity-type-page/edit-bar-type-editor.test.tsx @@ -8,7 +8,7 @@ import { EditBarTypeEditor } from "./edit-bar-type-editor"; import type { ReactNode } from "react"; const formState = vi.hoisted(() => ({ - dirtyFields: {} as Record, + dirtyFields: {}, isSubmitting: false, })); diff --git a/apps/hash-frontend/src/pages/shared/entity-type-page/use-entity-type-dependents.ts b/apps/hash-frontend/src/pages/shared/entity-type-page/use-entity-type-dependents.ts index 3db7945281a..86af53deeb2 100644 --- a/apps/hash-frontend/src/pages/shared/entity-type-page/use-entity-type-dependents.ts +++ b/apps/hash-frontend/src/pages/shared/entity-type-page/use-entity-type-dependents.ts @@ -112,7 +112,7 @@ export const useGetEntityTypeDependents = (): { const userWebs = useMemo(() => { return [ - authenticatedUser.accountId as WebId, + authenticatedUser.accountId, ...authenticatedUser.memberOf.map(({ org }) => org.webId), ]; }, [authenticatedUser]); diff --git a/apps/hash-frontend/src/pages/shared/entity/entity-editor/history-section/history-table/shared/event-detail.tsx b/apps/hash-frontend/src/pages/shared/entity/entity-editor/history-section/history-table/shared/event-detail.tsx index eb1758f9478..9c1a6023db1 100644 --- a/apps/hash-frontend/src/pages/shared/entity/entity-editor/history-section/history-table/shared/event-detail.tsx +++ b/apps/hash-frontend/src/pages/shared/entity/entity-editor/history-section/history-table/shared/event-detail.tsx @@ -11,7 +11,7 @@ import { stringifyPropertyValue } from "@local/hash-isomorphic-utils/stringify-p import { ValueChip } from "../../../../../value-chip"; import type { HistoryEvent } from "../../shared/types"; -import type { EntityRootType, Subgraph } from "@blockprotocol/graph"; +import type { Subgraph } from "@blockprotocol/graph"; const createValueText = (value: PropertyValue, metadata: PropertyMetadata) => { if (isValueMetadata(metadata)) { @@ -38,10 +38,7 @@ export const EventDetail = ({ }) => { switch (event.type) { case "created": { - const entityLabel = generateEntityLabel( - subgraph as Subgraph, - event.entity, - ); + const entityLabel = generateEntityLabel(subgraph, event.entity); return ( <> {entityLabel} diff --git a/apps/hash-frontend/src/pages/shared/entity/entity-editor/links-section/outgoing-links-section/cells/linked-with-cell/create-draft-link-entity.ts b/apps/hash-frontend/src/pages/shared/entity/entity-editor/links-section/outgoing-links-section/cells/linked-with-cell/create-draft-link-entity.ts index 398703b84c1..8699bc1ea49 100644 --- a/apps/hash-frontend/src/pages/shared/entity/entity-editor/links-section/outgoing-links-section/cells/linked-with-cell/create-draft-link-entity.ts +++ b/apps/hash-frontend/src/pages/shared/entity/entity-editor/links-section/outgoing-links-section/cells/linked-with-cell/create-draft-link-entity.ts @@ -1,11 +1,7 @@ import { currentTimestamp } from "@blockprotocol/type-system"; import { HashEntity } from "@local/hash-graph-sdk/entity"; -import type { - ActorEntityUuid, - EntityId, - VersionedUrl, -} from "@blockprotocol/type-system"; +import type { EntityId, VersionedUrl } from "@blockprotocol/type-system"; /** * @todo - This is unsafe, and should be refactored to return a new type `DraftEntity`, so that we aren't @@ -30,11 +26,11 @@ export const createDraftLinkEntity = ({ recordId: { editionId: "", entityId: `draft~${Date.now()}` as EntityId }, entityTypeIds: [linkEntityTypeId], provenance: { - createdById: "" as ActorEntityUuid, + createdById: "", createdAtTransactionTime: currentTimestamp(), createdAtDecisionTime: currentTimestamp(), edition: { - createdById: "" as ActorEntityUuid, + createdById: "", actorType: "user", origin: { type: "api" }, }, diff --git a/apps/hash-frontend/src/pages/shared/entity/entity-editor/links-section/outgoing-links-section/cells/linked-with-cell/linked-entity-selector.tsx b/apps/hash-frontend/src/pages/shared/entity/entity-editor/links-section/outgoing-links-section/cells/linked-with-cell/linked-entity-selector.tsx index 79d7a0b1a92..e105256eae1 100644 --- a/apps/hash-frontend/src/pages/shared/entity/entity-editor/links-section/outgoing-links-section/cells/linked-with-cell/linked-entity-selector.tsx +++ b/apps/hash-frontend/src/pages/shared/entity/entity-editor/links-section/outgoing-links-section/cells/linked-with-cell/linked-entity-selector.tsx @@ -148,7 +148,7 @@ export const LinkedEntitySelector = ({ ] ?? "File"; - onSelect(upload.createdEntities.fileEntity as HashEntity, label); + onSelect(upload.createdEntities.fileEntity, label); }, webId: activeWorkspaceWebId, /** diff --git a/apps/hash-frontend/src/pages/shared/entity/entity-editor/properties-section/property-table/cells/value-cell/editor-type-picker.test.tsx b/apps/hash-frontend/src/pages/shared/entity/entity-editor/properties-section/property-table/cells/value-cell/editor-type-picker.test.tsx index aacb7667f94..123cf3091d0 100644 --- a/apps/hash-frontend/src/pages/shared/entity/entity-editor/properties-section/property-table/cells/value-cell/editor-type-picker.test.tsx +++ b/apps/hash-frontend/src/pages/shared/entity/entity-editor/properties-section/property-table/cells/value-cell/editor-type-picker.test.tsx @@ -42,7 +42,7 @@ beforeAll(() => { observe() {} unobserve() {} - } as unknown as typeof ResizeObserver; + }; HTMLElement.prototype.scrollIntoView = scrollIntoView; }); diff --git a/apps/hash-frontend/src/pages/shared/entity/entity-editor/properties-section/property-table/use-rows/use-property-rows-from-entity.ts b/apps/hash-frontend/src/pages/shared/entity/entity-editor/properties-section/property-table/use-rows/use-property-rows-from-entity.ts index f6db77dd07f..8604099ae51 100644 --- a/apps/hash-frontend/src/pages/shared/entity/entity-editor/properties-section/property-table/use-rows/use-property-rows-from-entity.ts +++ b/apps/hash-frontend/src/pages/shared/entity/entity-editor/properties-section/property-table/use-rows/use-property-rows-from-entity.ts @@ -79,7 +79,7 @@ export const usePropertyRowsFromEntity = (): PropertyRow[] => { return typedKeys(closedMultiEntityType.properties).flatMap( (propertyTypeBaseUrl) => { - if (processedPropertyTypes.has(propertyTypeBaseUrl as BaseUrl)) { + if (processedPropertyTypes.has(propertyTypeBaseUrl)) { return []; } @@ -90,14 +90,14 @@ export const usePropertyRowsFromEntity = (): PropertyRow[] => { throw new Error(`Property ${propertyTypeBaseUrl} not found`); } - processedPropertyTypes.add(propertyTypeBaseUrl as BaseUrl); + processedPropertyTypes.add(propertyTypeBaseUrl); return generatePropertyRowRecursively({ closedMultiEntityType, closedMultiEntityTypesDefinitions, generateNewMetadataObject, - propertyTypeBaseUrl: propertyTypeBaseUrl as BaseUrl, - propertyKeyChain: [propertyTypeBaseUrl as BaseUrl], + propertyTypeBaseUrl, + propertyKeyChain: [propertyTypeBaseUrl], entity, requiredPropertyTypes: (closedMultiEntityType.required as BaseUrl[] | undefined) ?? [], diff --git a/apps/hash-frontend/src/pages/shared/entity/query-editor.tsx b/apps/hash-frontend/src/pages/shared/entity/query-editor.tsx index 067b6bc9691..33d897753c5 100644 --- a/apps/hash-frontend/src/pages/shared/entity/query-editor.tsx +++ b/apps/hash-frontend/src/pages/shared/entity/query-editor.tsx @@ -19,7 +19,6 @@ import { EntityHeader } from "./entity-header"; import type { EntityEditorProps } from "./entity-editor"; import type { MultiFilter } from "@blockprotocol/graph"; -import type { Entity as EntityBp } from "@blockprotocol/type-system"; interface QueryEditorProps extends EntityEditorProps { handleSaveQuery: (value: MultiFilter) => Promise; @@ -73,7 +72,7 @@ export const QueryEditor = (props: QueryEditorProps) => { throw new Error(res.errors?.[0]?.message ?? "Unknown error"); } - return getRoots(res.data.results) as EntityBp[]; + return getRoots(res.data.results); }, [queryEntities], ); diff --git a/apps/hash-frontend/src/pages/shared/filter-bar/use-internal-webs.ts b/apps/hash-frontend/src/pages/shared/filter-bar/use-internal-webs.ts index 21c70792916..f97473d15a1 100644 --- a/apps/hash-frontend/src/pages/shared/filter-bar/use-internal-webs.ts +++ b/apps/hash-frontend/src/pages/shared/filter-bar/use-internal-webs.ts @@ -2,7 +2,6 @@ import { useMemoCompare } from "../../../shared/use-memo-compare"; import { useAuthenticatedUser } from "../auth-info-context"; import type { InternalWeb } from "./web-filter-pill"; -import type { WebId } from "@blockprotocol/type-system"; /** * The authenticated user's own and org webs for the web filter pill, with a @@ -14,7 +13,7 @@ export const useInternalWebs = (): InternalWeb[] => { return useMemoCompare( () => [ { - webId: authenticatedUser.accountId as WebId, + webId: authenticatedUser.accountId, name: `@${authenticatedUser.shortname}`, }, ...authenticatedUser.memberOf.map(({ org }) => ({ diff --git a/apps/hash-frontend/src/pages/shared/web-selector.tsx b/apps/hash-frontend/src/pages/shared/web-selector.tsx index c148a354708..2d968813391 100644 --- a/apps/hash-frontend/src/pages/shared/web-selector.tsx +++ b/apps/hash-frontend/src/pages/shared/web-selector.tsx @@ -79,7 +79,7 @@ export const WebSelector = ({ /> ), label: "My web", - value: authenticatedUser.accountId as WebId, + value: authenticatedUser.accountId, }, ...authenticatedUser.memberOf.map( ({ org: { webId, name, hasAvatar } }) => ({ diff --git a/apps/hash-frontend/src/pages/shared/workspace-context-provider.tsx b/apps/hash-frontend/src/pages/shared/workspace-context-provider.tsx index ecb1c162e84..1a9bc4df586 100644 --- a/apps/hash-frontend/src/pages/shared/workspace-context-provider.tsx +++ b/apps/hash-frontend/src/pages/shared/workspace-context-provider.tsx @@ -41,7 +41,7 @@ export const WorkspaceContextProvider: FunctionComponent<{ } else if (authenticatedUser) { const defaultWorkspaceWebId = authenticatedUser.memberOf[0]?.org.webId ?? - (authenticatedUser.accountId as WebId); + authenticatedUser.accountId; /** * Initialize the `activeWorkspaceWebId` to the first organization the @@ -70,8 +70,7 @@ export const WorkspaceContextProvider: FunctionComponent<{ */ if (activeWorkspaceWebId && authenticatedUser && !activeWorkspace) { updateActiveWorkspaceWebId( - authenticatedUser.memberOf[0]?.org.webId ?? - (authenticatedUser.accountId as WebId), + authenticatedUser.memberOf[0]?.org.webId ?? authenticatedUser.accountId, ); } }, [ diff --git a/apps/hash-frontend/src/pages/signin.page.tsx b/apps/hash-frontend/src/pages/signin.page.tsx index 1938bde9f16..07d2164c4d1 100644 --- a/apps/hash-frontend/src/pages/signin.page.tsx +++ b/apps/hash-frontend/src/pages/signin.page.tsx @@ -27,7 +27,6 @@ import { WorkspaceContext } from "./shared/workspace-context"; import type { NextPageWithLayout } from "../shared/layout"; import type { ButtonProps } from "../shared/ui"; -import type { WebId } from "@blockprotocol/type-system"; import type { LoginFlow } from "@ory/client"; import type { AxiosError } from "axios"; import type { FormEventHandler } from "react"; @@ -255,7 +254,7 @@ const SigninPage: NextPageWithLayout = () => { throw new Error("Could not fetch authenticated user after logging in."); } - updateActiveWorkspaceWebId(authenticatedUser.accountId as WebId); + updateActiveWorkspaceWebId(authenticatedUser.accountId); void router.push( returnTo ?? getSafeReturnToPath(activeFlow.return_to) ?? "/", ); diff --git a/apps/hash-frontend/src/pages/supply-chain/shared/data.ts b/apps/hash-frontend/src/pages/supply-chain/shared/data.ts index 63e57b17e22..2f88728c2b7 100644 --- a/apps/hash-frontend/src/pages/supply-chain/shared/data.ts +++ b/apps/hash-frontend/src/pages/supply-chain/shared/data.ts @@ -115,9 +115,7 @@ const getActiveWebId = (): WebId => { }; export function fetchProducts(): Promise { - productsCache = - productsCache ?? - (fetchAnalysisProducts(getActiveWebId()) as Promise); + productsCache = productsCache ?? fetchAnalysisProducts(getActiveWebId()); return productsCache; } diff --git a/apps/hash-frontend/src/pages/supply-chain/shared/status-dialog/status-editor.test.tsx b/apps/hash-frontend/src/pages/supply-chain/shared/status-dialog/status-editor.test.tsx index 189b5f927a0..e6422a3cf9a 100644 --- a/apps/hash-frontend/src/pages/supply-chain/shared/status-dialog/status-editor.test.tsx +++ b/apps/hash-frontend/src/pages/supply-chain/shared/status-dialog/status-editor.test.tsx @@ -25,7 +25,7 @@ beforeAll(() => { observe() {} unobserve() {} - } as unknown as typeof ResizeObserver; + }; HTMLElement.prototype.scrollIntoView = scrollIntoView; Range.prototype.getClientRects = () => [] as unknown as DOMRectList; Range.prototype.getBoundingClientRect = () => diff --git a/apps/hash-frontend/src/pages/supply-chain/shared/step-detail-panel/data-table-section.tsx b/apps/hash-frontend/src/pages/supply-chain/shared/step-detail-panel/data-table-section.tsx index a9358e5130c..298ee1a72d2 100644 --- a/apps/hash-frontend/src/pages/supply-chain/shared/step-detail-panel/data-table-section.tsx +++ b/apps/hash-frontend/src/pages/supply-chain/shared/step-detail-panel/data-table-section.tsx @@ -506,7 +506,7 @@ export const DataTableSection = forwardRef< if (!detailRows?.rows) { return []; } - return detailRows.rows as Record[]; + return detailRows.rows; }, [detailRows]); const table = useReactTable({ data, @@ -690,6 +690,7 @@ export const DataTableSection = forwardRef< {table.getHeaderGroups().map((headerGroup) => ( {headerGroup.headers.map((header) => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: ColumnMeta omits our numeric flag. const meta = header.column.columnDef.meta as | { numeric?: boolean } | undefined; @@ -744,6 +745,7 @@ export const DataTableSection = forwardRef< {table.getRowModel().rows.map((row) => ( {row.getVisibleCells().map((cell) => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- false positive: ColumnMeta omits our numeric flag. const meta = cell.column.columnDef.meta as | { numeric?: boolean } | undefined; diff --git a/apps/hash-frontend/src/pages/supply-chain/shared/use-search-params.ts b/apps/hash-frontend/src/pages/supply-chain/shared/use-search-params.ts index 5bb235c1621..3e830d554fa 100644 --- a/apps/hash-frontend/src/pages/supply-chain/shared/use-search-params.ts +++ b/apps/hash-frontend/src/pages/supply-chain/shared/use-search-params.ts @@ -66,7 +66,7 @@ export function useSearchParams(): [URLSearchParams, SetURLSearchParams] { const resolved = typeof nextInit === "function" ? nextInit(new URLSearchParams(optimisticQueryString)) - : new URLSearchParams(nextInit as Record | undefined); + : new URLSearchParams(nextInit); const path = router.asPath.split("?")[0]; if (!path) { diff --git a/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/process-graph.tsx b/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/process-graph.tsx index dd1ca02dec1..a64dacb0f20 100644 --- a/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/process-graph.tsx +++ b/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/process-graph.tsx @@ -24,7 +24,7 @@ import { StepNode } from "./process-graph/step-node"; import type { GraphData, GraphNode, GraphEdge } from "../../shared/types"; const nodeTypes: NodeTypes = { - stepNode: StepNode as unknown as NodeTypes[string], + stepNode: StepNode, }; const canvasShell = css({ @@ -242,9 +242,7 @@ export const ProcessGraph = ({ const containerCallbackRef = useCallback( (el: HTMLDivElement | null) => { if (el) { - ( - containerRef as React.MutableRefObject - ).current = el; + containerRef.current = el; el.addEventListener("fullscreenchange", onFullscreenChange); } }, diff --git a/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/production-schedule.test.tsx b/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/production-schedule.test.tsx index 6f3f9ce8a9a..d6d4cf535b0 100644 --- a/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/production-schedule.test.tsx +++ b/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/production-schedule.test.tsx @@ -1358,30 +1358,28 @@ describe("ProductionScheduleView", () => { clientHeight: { configurable: true, value: 600 }, clientWidth: { configurable: true, value: 800 }, }); - frame.getBoundingClientRect = () => - ({ - bottom: 600, - height: 600, - left: 0, - right: 800, - top: 0, - width: 800, - x: 0, - y: 0, - toJSON: () => ({}), - }) as DOMRect; - batch.getBoundingClientRect = () => - ({ - bottom: 430, - height: 30, - left: 600, - right: 700, - top: 400, - width: 100, - x: 600, - y: 400, - toJSON: () => ({}), - }) as DOMRect; + frame.getBoundingClientRect = () => ({ + bottom: 600, + height: 600, + left: 0, + right: 800, + top: 0, + width: 800, + x: 0, + y: 0, + toJSON: () => ({}), + }); + batch.getBoundingClientRect = () => ({ + bottom: 430, + height: 30, + left: 600, + right: 700, + top: 400, + width: 100, + x: 600, + y: 400, + toJSON: () => ({}), + }); fireEvent.change( screen.getByRole("searchbox", { diff --git a/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/production-schedule/timeline-tooltip.test.tsx b/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/production-schedule/timeline-tooltip.test.tsx index 33dfaeed81c..8c5a157aa3f 100644 --- a/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/production-schedule/timeline-tooltip.test.tsx +++ b/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/product/production-schedule/timeline-tooltip.test.tsx @@ -9,18 +9,17 @@ const rect = ( top: number, width: number, height: number, -): DOMRect => - ({ - bottom: top + height, - height, - left, - right: left + width, - top, - width, - x: left, - y: top, - toJSON: () => ({}), - }) as DOMRect; +): DOMRect => ({ + bottom: top + height, + height, + left, + right: left + width, + top, + width, + x: left, + y: top, + toJSON: () => ({}), +}); afterEach(() => { vi.restoreAllMocks(); diff --git a/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/site/shared/supply-chain-filters/operators.ts b/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/site/shared/supply-chain-filters/operators.ts index 6ad1c257835..81e53ff8d87 100644 --- a/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/site/shared/supply-chain-filters/operators.ts +++ b/apps/hash-frontend/src/pages/supply-chain/supply-chain-data-shell/site/shared/supply-chain-filters/operators.ts @@ -96,7 +96,7 @@ export const pickOperators = < keys: ReadonlyArray, ): SupplyChainFilterOperator[] => keys.flatMap((key) => { - const config = map[key] as OperatorConfig | undefined; + const config = map[key]; return config ? [{ key, label: config.label, input: config.input }] : []; }); diff --git a/apps/hash-frontend/src/pages/types/external/entity-type/[...base64-baseurl-maybe-version].page.test.tsx b/apps/hash-frontend/src/pages/types/external/entity-type/[...base64-baseurl-maybe-version].page.test.tsx index d9a1d89f350..75a0556122a 100644 --- a/apps/hash-frontend/src/pages/types/external/entity-type/[...base64-baseurl-maybe-version].page.test.tsx +++ b/apps/hash-frontend/src/pages/types/external/entity-type/[...base64-baseurl-maybe-version].page.test.tsx @@ -4,7 +4,7 @@ import { describe, expect, test, vi } from "vitest"; import Page from "./[...base64-baseurl-maybe-version].page"; const router = vi.hoisted(() => ({ - query: {} as Record, + query: {}, asPath: "", })); diff --git a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/workspace-switcher.tsx b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/workspace-switcher.tsx index 77ce44a90e6..bef221cabd7 100644 --- a/apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/workspace-switcher.tsx +++ b/apps/hash-frontend/src/shared/layout/layout-with-sidebar/sidebar/workspace-switcher.tsx @@ -24,8 +24,6 @@ import { getImageUrlFromEntityProperties } from "../../../../pages/shared/get-fi import { useActiveWorkspace } from "../../../../pages/shared/workspace-context"; import { Button, MenuItem } from "../../../ui"; -import type { WebId } from "@blockprotocol/type-system"; - export const WorkspaceSwitcher = () => { const popupState = usePopupState({ variant: "popover", @@ -77,7 +75,7 @@ export const WorkspaceSwitcher = () => { const workspaceList = useMemo(() => { return [ { - webId: authenticatedUser.accountId as WebId, + webId: authenticatedUser.accountId, title: "My personal workspace", subText: `@${authenticatedUser.shortname ?? "user"}`, avatarTitle: authenticatedUser.displayName ?? "U", diff --git a/apps/hash-integration-worker/src/activities/flow-activities/shared/split-properties-and-metadata.ts b/apps/hash-integration-worker/src/activities/flow-activities/shared/split-properties-and-metadata.ts index 15712ec6bf8..80f86959785 100644 --- a/apps/hash-integration-worker/src/activities/flow-activities/shared/split-properties-and-metadata.ts +++ b/apps/hash-integration-worker/src/activities/flow-activities/shared/split-properties-and-metadata.ts @@ -9,7 +9,6 @@ import type { PropertyObject, PropertyObjectMetadata, PropertyValue, - PropertyValueMetadata, PropertyWithMetadata, } from "@blockprotocol/type-system"; diff --git a/libs/@hashintel/design-system/src/theme.ts b/libs/@hashintel/design-system/src/theme.ts index f8571a7494b..73c66edee2e 100644 --- a/libs/@hashintel/design-system/src/theme.ts +++ b/libs/@hashintel/design-system/src/theme.ts @@ -7,8 +7,6 @@ import { palette } from "./theme/palette"; import { boxShadows, dropShadows, shadows } from "./theme/shadows"; import { typography } from "./theme/typography"; -import type { ThemeOptions } from "@mui/material"; - export const theme = createTheme({ palette, typography, diff --git a/libs/@hashintel/ds-components/src/components/Avatar/avatar.tsx b/libs/@hashintel/ds-components/src/components/Avatar/avatar.tsx index b139f918760..325c18addf0 100644 --- a/libs/@hashintel/ds-components/src/components/Avatar/avatar.tsx +++ b/libs/@hashintel/ds-components/src/components/Avatar/avatar.tsx @@ -139,26 +139,19 @@ export const Avatar = ({ }; if (asLink) { - return ( - )}> - {content} - - ); + return {content}; } if (asButton) { return ( - ); } return ( -
)} role="img"> +
{content}
); diff --git a/libs/@hashintel/ds-components/src/components/Banner/banner.tsx b/libs/@hashintel/ds-components/src/components/Banner/banner.tsx index c4939e7bce2..907ef5e7752 100644 --- a/libs/@hashintel/ds-components/src/components/Banner/banner.tsx +++ b/libs/@hashintel/ds-components/src/components/Banner/banner.tsx @@ -128,7 +128,7 @@ export const BannerActionButton = ({ }: ButtonProps) => (