Describe the bug
When running leadtype lint on Windows, TS/JS code snippet typechecking silently passes even when snippets contain compile/type errors. This happens because the virtual compiler host looks up virtual files using normalized paths (forward slashes /), while the virtual file cache keys are stored with mixed separators.
Steps to reproduce
- On Windows, create a document containing a TS code block with a type error (e.g.
greet(42) where it expects string).
- Run
leadtype lint (or run vitest on packages/leadtype/src/lint/snippet-typecheck.test.ts).
- Observe that the typechecking violations are not caught and the command returns exit code
0.
Cause
In packages/leadtype/src/lint/snippet-typecheck.ts, virtualDir is resolved via projectRoot (using Windows backslashes \), and the file name is joined using /:
const virtualDir = `${projectRoot}/.leadtype-snippet-${index}`;
Describe the bug
When running
leadtype linton Windows, TS/JS code snippet typechecking silently passes even when snippets contain compile/type errors. This happens because the virtual compiler host looks up virtual files using normalized paths (forward slashes/), while the virtual file cache keys are stored with mixed separators.Steps to reproduce
greet(42)where it expectsstring).leadtype lint(or run vitest onpackages/leadtype/src/lint/snippet-typecheck.test.ts).0.Cause
In packages/leadtype/src/lint/snippet-typecheck.ts,
virtualDiris resolved viaprojectRoot(using Windows backslashes\), and the file name is joined using/: