Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scripts/typecheck.test.mjs
Original file line number Diff line number Diff line change
@@ -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}`,
);
});
});
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
Loading