From 731612c04d1dcfd63ec04cd94f8b3d821b5d67c9 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 12:50:28 +0900 Subject: [PATCH] =?UTF-8?q?fix(typecheck):=20route-runtime=20=EC=9D=8C?= =?UTF-8?q?=EC=84=B1=20fixture=EA=B0=80=20=EC=9D=B4=20=EC=A0=9C=ED=92=88?= =?UTF-8?q?=EC=9D=98=20=EA=B2=BD=EB=A1=9C=EB=A1=9C=20=EC=A7=84=EB=8B=A8?= =?UTF-8?q?=EC=9D=84=20=EB=82=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FE-GATE-003의 route-runtime 음성 fixture는 템플릿 그대로 `{ APP_HOME: true } satisfies Record`이다. 이 제품에는 APP_HOME 경로가 없어서, 기대한 「빠진 경로」 진단(TS2740) 대신 「모르는 속성」(TS2353)이 나와 UNEXPECTED_DIAGNOSTIC로 떨어진다. 템플릿 e47a0ab2와 같은 방식으로 고친다. 정확히 한 경로만 뺀 `Omit, "TECH_LOG_HOME">`을 대입하고, 기대 진단을 TS2741로 바꾼다. 빠진 키가 하나면 경로 수와 상관없이 TS2741이다(TS2739· TS2740은 빠진 목록의 길이에 따라 갈린다). 뺄 경로는 이 제품에 있는 TECH_LOG_HOME이다. 검증: tsc -p tests/fixtures/typecheck/tsconfig.route-runtime.json이 TS2741(missingRuntime)과 TS2353(ORPHAN_ROUTE, 두 번째 음성 경우)을 낸다. --- config/ci/gates.json | 2 +- tests/fixtures/typecheck/invalid-route-runtime.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config/ci/gates.json b/config/ci/gates.json index 6b47221..61bbb81 100644 --- a/config/ci/gates.json +++ b/config/ci/gates.json @@ -144,7 +144,7 @@ "script": "check:types:fixture:route-runtime", "expect": "fail", "expectedExitCode": 1, - "expectedDiagnosticId": "error TS2740:" + "expectedDiagnosticId": "error TS2741:" }, { "id": "check-types-fixture-page-action", diff --git a/tests/fixtures/typecheck/invalid-route-runtime.ts b/tests/fixtures/typecheck/invalid-route-runtime.ts index 9fa3f9d..cfd12b0 100644 --- a/tests/fixtures/typecheck/invalid-route-runtime.ts +++ b/tests/fixtures/typecheck/invalid-route-runtime.ts @@ -2,9 +2,13 @@ import { ROUTE_RUNTIME_CONTRACT } from "../../../src/features/installed-feature- type RouteId = keyof typeof ROUTE_RUNTIME_CONTRACT; -export const missingRuntime = { - APP_HOME: true, -} satisfies Record; +// Exactly one route is left out, as the template does since e47a0ab2 (2026-11-07): +// one missing key is TS2741 at any route count, where a short or long list of +// missing keys is TS2739 or TS2740. The left-out route must exist here: this +// product has no APP_HOME, and the template's literal { APP_HOME: true } failed +// as an unknown property (TS2353) instead of the missing-runtime error. +declare const withoutHome: Omit, "TECH_LOG_HOME">; +export const missingRuntime: Record = withoutHome; export const orphanRuntime = { ...Object.fromEntries(