Skip to content

Commit 7464ad8

Browse files
committed
Stub in a type for instanbul-lib-report
Adding the local ReportBase stub bridges a gap between the freshly updated typings and what ships on npm. `@types/istanbul-reports@3.x` (pulled in transitively by the Jest 30 toolchain) now depends on `istanbul-lib-report` exposing a `ReportBase` type. However, `istanbul-lib-report` never published TypeScript definitions, and the companion `@types/istanbul-lib-report` package on DefinitelyTyped still targets the old API and does not declare `ReportBase`. Because TypeScript resolves the `.d.ts` first, the missing export breaks the build: npm run build > get-azure-pipelines-artifact@0.3.1 build > tsc node_modules/@types/istanbul-reports/index.d.ts:1:16 - error TS2305: Module '"istanbul-lib-report"' has no exported member 'ReportBase'. 1 import { Node, ReportBase } from "istanbul-lib-report"; ~~~~~~~~~~ Found 1 error in node_modules/@types/istanbul-reports/index.d.ts:1 Until either `istanbul-lib-report` publishes its own typings or the DefinitelyTyped package is updated, we patch the gap locally with a minimal augmentation so the compiler can see the symbol and keep the new Jest stack happy. Assisted-by: GPT-5-Codex Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent f03bbdc commit 7464ad8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"noUnusedLocals": true,
1111
"noUnusedParameters": true
1212
},
13-
"include": ["**/*.ts"],
13+
"include": ["**/*.ts", "**/*.d.ts"],
1414
"exclude": ["node_modules"]
1515
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { Context as IstanbulContext } from 'istanbul-lib-report';
2+
3+
declare module 'istanbul-lib-report' {
4+
export class ReportBase {
5+
constructor(options?: { summarizer?: string });
6+
execute(context: IstanbulContext): void;
7+
}
8+
}

0 commit comments

Comments
 (0)