fix(lsp): improved cjs tracking (#23374)

Our cjs tracking was a bit broken. It was marking stuff as esm that was
actually cjs leading to type checking errors.
This commit is contained in:
David Sherret 2024-04-15 17:50:52 -04:00 committed by GitHub
parent 7e4ee02e2e
commit 6f278e5c40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 263 additions and 102 deletions

View file

@ -0,0 +1,15 @@
{
"tempDir": true,
"envs": {
"DENO_FUTURE": "1"
},
"steps": [{
"commandName": "npm",
"args": "install",
"output": "[WILDCARD]"
}, {
"args": "check main.ts",
"exitCode": 1,
"output": "main.out"
}]
}

View file

@ -0,0 +1,5 @@
Check file:///[WILDLINE]/main.ts
error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'number'.
add(1, "test"); // should error
~~~~~~
at file:///[WILDLINE]/main.ts:3:8

View file

@ -0,0 +1,3 @@
import { add } from "@denotest/cjs-internal-types-default-export";
add(1, "test"); // should error

View file

@ -0,0 +1,5 @@
{
"dependencies": {
"@denotest/cjs-internal-types-default-export": "*"
}
}