From 3fe67258710f06a1860b43ac6fcc9deb76721bf0 Mon Sep 17 00:00:00 2001 From: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 03:41:43 -0500 Subject: [PATCH] test: fix broken typecheck script and add regression test tsconfig.json extends @docusaurus/tsconfig, which still sets baseUrl. typescript ~7.0.2 removed that option entirely (TS5102), so npm run typecheck has been failing immediately with zero signal anywhere. Override the inherited baseUrl to null in our own compilerOptions to strip it from the merged config tsc evaluates. Add scripts/typecheck.test.mjs, which shells out to npx tsc --noEmit and asserts a zero exit code, so this is covered by the existing scripts/**/*.test.mjs glob in test:unit with no CI workflow change needed. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- scripts/typecheck.test.mjs | 23 +++++++++++++++++++++++ tsconfig.json | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 scripts/typecheck.test.mjs diff --git a/scripts/typecheck.test.mjs b/scripts/typecheck.test.mjs new file mode 100644 index 00000000..4379f794 --- /dev/null +++ b/scripts/typecheck.test.mjs @@ -0,0 +1,23 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import { spawnSync } from 'node:child_process'; +import path from 'node:path'; +import url from 'node:url'; + +const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); +const repoRoot = path.join(__dirname, '..'); + +describe('npm run typecheck', () => { + it('runs tsc against tsconfig.json without TS5102 (removed baseUrl option)', () => { + const result = spawnSync('npx', ['tsc', '--noEmit'], { + cwd: repoRoot, + encoding: 'utf-8', + }); + + assert.equal( + result.status, + 0, + `tsc exited with ${result.status}:\n${result.stdout}${result.stderr}`, + ); + }); +}); diff --git a/tsconfig.json b/tsconfig.json index 7117c4fa..91e7e33c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,11 @@ "extends": "@docusaurus/tsconfig", "compilerOptions": { "ignoreDeprecations": "6.0", - "allowImportingTsExtensions": true + "allowImportingTsExtensions": true, + // @docusaurus/tsconfig still sets baseUrl, which TS 5.5+ (we're on ~7.0.2) + // rejects with TS5102 ("Option 'baseUrl' has been removed"). Overriding it + // to null here strips the inherited value from the merged config. + "baseUrl": null }, "exclude": [".docusaurus", "build"] }