@@ -22,7 +22,7 @@ const check = (name, fn) => {
2222
2323// Every package ships exactly the files it lists, and those files load.
2424const shipped = {
25- tsconfig : [ "app.json" , "base.json" ] ,
25+ tsconfig : [ "app.json" , "base.json" , "test-d.json" ] ,
2626 typedoc : [ "base.json" ] ,
2727 oxlint : [ "base.json" ] ,
2828 oxfmt : [ "base.json" ] ,
@@ -58,6 +58,34 @@ check("tsconfig/app.json extends base and emits no declarations", () => {
5858 }
5959} ) ;
6060
61+ check ( "tsconfig/test-d.json is exactly the two unused-check relaxations" , ( ) => {
62+ const testD = json ( "packages/tsconfig/test-d.json" ) ;
63+ // An ALLOW-list, not a deny-list: this preset is layered LAST in a consumer's
64+ // `extends` array, so anything it grows silently overrides the workspace's
65+ // own config. Naming what may appear is the only shape that catches a key
66+ // nobody thought to forbid.
67+ //
68+ // `include` / `exclude` / `files` are the ones a reader will reach for and
69+ // they cannot work here: TypeScript resolves a base config's globs relative
70+ // to the BASE file's own directory, so a shipped glob points inside
71+ // node_modules and matches nothing (measured: TS18003).
72+ const top = Object . keys ( testD ) . sort ( ) ;
73+ if ( top . join ( ) !== "$schema,compilerOptions" ) {
74+ throw new Error ( `top-level keys must be $schema + compilerOptions, got: ${ top . join ( ", " ) } ` ) ;
75+ }
76+ const options = Object . keys ( testD . compilerOptions ?? { } ) . sort ( ) ;
77+ if ( options . join ( ) !== "noUnusedLocals,noUnusedParameters" ) {
78+ throw new Error (
79+ `compilerOptions must be exactly the two unused checks, got: ${ options . join ( ", " ) } ` ,
80+ ) ;
81+ }
82+ // An assertion binding is never read, so both must be OFF — the whole reason
83+ // this file exists.
84+ for ( const flag of options ) {
85+ if ( testD . compilerOptions [ flag ] !== false ) throw new Error ( `${ flag } must be false` ) ;
86+ }
87+ } ) ;
88+
6189check ( "typedoc/base.json loads the markdown plugin" , ( ) => {
6290 const td = json ( "packages/typedoc/base.json" ) ;
6391 if ( ! td . plugin ?. includes ( "typedoc-plugin-markdown" ) ) {
0 commit comments