fix(typecheck): route-runtime 음성 fixture가 이 제품의 경로로 진단을 낸다
FE-GATE-003의 route-runtime 음성 fixture는 템플릿 그대로
`{ APP_HOME: true } satisfies Record<RouteId, boolean>`이다. 이 제품에는
APP_HOME 경로가 없어서, 기대한 「빠진 경로」 진단(TS2740) 대신 「모르는
속성」(TS2353)이 나와 UNEXPECTED_DIAGNOSTIC로 떨어진다.
템플릿 e47a0ab2와 같은 방식으로 고친다. 정확히 한 경로만 뺀
`Omit<Record<RouteId, boolean>, "TECH_LOG_HOME">`을 대입하고, 기대 진단을
TS2741로 바꾼다. 빠진 키가 하나면 경로 수와 상관없이 TS2741이다(TS2739·
TS2740은 빠진 목록의 길이에 따라 갈린다). 뺄 경로는 이 제품에 있는
TECH_LOG_HOME이다.
검증: tsc -p tests/fixtures/typecheck/tsconfig.route-runtime.json이
TS2741(missingRuntime)과 TS2353(ORPHAN_ROUTE, 두 번째 음성 경우)을 낸다.
This commit is contained in:
@@ -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",
|
||||
|
||||
+7
-3
@@ -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<RouteId, boolean>;
|
||||
// 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<Record<RouteId, boolean>, "TECH_LOG_HOME">;
|
||||
export const missingRuntime: Record<RouteId, boolean> = withoutHome;
|
||||
|
||||
export const orphanRuntime = {
|
||||
...Object.fromEntries(
|
||||
|
||||
Reference in New Issue
Block a user