diff --git a/plugins/vscode/tsconfig.json b/plugins/vscode/tsconfig.json index dc18be16..cb0feeca 100644 --- a/plugins/vscode/tsconfig.json +++ b/plugins/vscode/tsconfig.json @@ -7,6 +7,11 @@ ], "sourceMap": true, "outDir": "dist", + // `include` reaches into source/ below, and TypeScript 7 infers a + // rootDir of plugins/vscode and rejects those files. The extension is + // bundled by esbuild (see build:ext) and tsc only type-checks this + // project, so widening rootDir to the repo root costs nothing. + "rootDir": "../..", "strict": true, "esModuleInterop": true, "skipLibCheck": true, diff --git a/source/wizards/steps/location-step.spec.tsx b/source/wizards/steps/location-step.spec.tsx index 4b0f014d..004c13d0 100644 --- a/source/wizards/steps/location-step.spec.tsx +++ b/source/wizards/steps/location-step.spec.tsx @@ -4,6 +4,7 @@ import {TitledBoxWithPreferences} from '@/components/ui/titled-box'; import {useResponsiveTerminal} from '@/hooks/useTerminalWidth'; import {renderWithTheme as render} from '@/test-utils/render-with-theme'; import React from 'react'; +import stripAnsi from 'strip-ansi'; import {LocationStep} from './location-step.js'; // Mirrors base-config-wizard.tsx's real LocationStep box. @@ -70,7 +71,9 @@ test('LocationStep shows the resolved project path next to the option', t => { const output = lastFrame(); t.truthy(output); - const lines = output!.split('\n'); + // The path is rendered dimmed, so the frame carries ANSI escapes whenever + // colour is on - which it is under CI. Compare against the plain text. + const lines = stripAnsi(output!).split('\n'); const stemIndex = lines.findIndex(line => line.includes('Current project directory'), ); diff --git a/tsconfig.json b/tsconfig.json index 454e4003..d08a39cf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,15 +16,16 @@ "declarationMap": true, "sourceMap": true, "types": ["node"], - "baseUrl": ".", + // TypeScript 7 removed `baseUrl` and rejects non-relative `paths` + // targets, so these resolve relative to this file instead. "paths": { - "@/*": ["source/*"], + "@/*": ["./source/*"], // The real `vscode` module only exists inside the extension host, so // AVA (which loads specs through tsx, and tsx honours these paths) // resolves it to a stub. Test-only: the extension is bundled from // plugins/vscode/tsconfig.json with `--external:vscode`, and nothing // under source/ imports it. - "vscode": ["plugins/vscode/test-stubs/vscode.ts"] + "vscode": ["./plugins/vscode/test-stubs/vscode.ts"] } }, "include": ["source/**/*"],