Skip to content

Commit 76d26ae

Browse files
committed
test(lint): hoist the batch-7 compile-time pins to exported types
The re-homed test compiled under the ui tsconfig, which does not set noUnusedLocals. packages/lint's tsconfig.test.json does, so the seven function-local `type _X = Assert<...>` pins read as unused (TS6196) and check:test-typecheck refused the file. Exported at module level they are used, and each still bites: flipping one expectation fails with TS2344. Claude-Session: https://claude.ai/code/session_01Xe3LjBvLrRVA6dmFUEGskm Co-authored-by: Claude <noreply@anthropic.com>
1 parent cde25c7 commit 76d26ae

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

‎packages/lint/src/sdui-spec-symbol-batch7.test.ts‎

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,17 @@ type Extends<A, B> = [A] extends [B] ? true : false;
4949
type IsAny<T> = 0 extends 1 & T ? true : false;
5050
type HasKey<T, K extends string> = K extends keyof T ? true : false;
5151

52-
describe('the spec ValidationResults are plugin-manifest results, this one is not', () => {
53-
it('is pinned at compile time', () => {
54-
// Load-bearing imports: the day the spec retires either name, this file
55-
// stops compiling and the convention can be revisited.
56-
type _KernelIsReal = Assert<Equal<IsAny<SpecKernelValidationResult>, false>>;
57-
type _ContractsIsReal = Assert<Equal<IsAny<SpecContractsValidationResult>, false>>;
52+
// Load-bearing imports: the day the spec retires either name, this file stops
53+
// compiling and the convention can be revisited. Exported so the strict
54+
// `noUnusedLocals` of tsconfig.test.json reads them as used.
55+
export type _KernelIsReal = Assert<Equal<IsAny<SpecKernelValidationResult>, false>>;
56+
export type _ContractsIsReal = Assert<Equal<IsAny<SpecContractsValidationResult>, false>>;
5857

59-
type _SpecCarriesAValidFlag = Assert<HasKey<SpecKernelValidationResult, 'valid'>>;
60-
type _ThisOneDoesNot = Assert<Equal<HasKey<ManifestValidationResult, 'valid'>, false>>;
61-
type _ThisOneCarriesRequires = Assert<HasKey<ManifestValidationResult, 'requires'>>;
58+
export type _SpecCarriesAValidFlag = Assert<HasKey<SpecKernelValidationResult, 'valid'>>;
59+
export type _ThisOneDoesNot = Assert<Equal<HasKey<ManifestValidationResult, 'valid'>, false>>;
60+
export type _ThisOneCarriesRequires = Assert<HasKey<ManifestValidationResult, 'requires'>>;
6261

63-
// Not assignable in either direction — sharing the name was never a
64-
// narrowing or a widening, it was two subjects under one word.
65-
type _NotAssignable = Assert<Equal<Extends<ManifestValidationResult, SpecKernelValidationResult>, false>>;
66-
type _NorTheOtherWay = Assert<Equal<Extends<SpecKernelValidationResult, ManifestValidationResult>, false>>;
67-
68-
expect(true).toBe(true);
69-
});
70-
});
62+
// Not assignable in either direction — sharing the name was never a narrowing
63+
// or a widening, it was two subjects under one word.
64+
export type _NotAssignable = Assert<Equal<Extends<ManifestValidationResult, SpecKernelValidationResult>, false>>;
65+
export type _NorTheOtherWay = Assert<Equal<Extends<SpecKernelValidationResult, ManifestValidationResult>, false>>;

0 commit comments

Comments
 (0)