fix(check): move types not found error to tsc diagnostic (#31509)

Closes https://github.com/denoland/deno/issues/31352
This commit is contained in:
David Sherret 2025-12-05 21:57:45 -05:00 committed by GitHub
parent 3a4b9de81e
commit 8c46ac3228
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 25 additions and 2 deletions

View file

@ -297,9 +297,9 @@ pub fn resolution_error_for_tsc_diagnostic(
| NodeJsErrorCode::ERR_UNSUPPORTED_ESM_URL_SCHEME
| NodeJsErrorCode::ERR_INVALID_FILE_URL_PATH
| NodeJsErrorCode::ERR_PACKAGE_IMPORT_NOT_DEFINED
| NodeJsErrorCode::ERR_PACKAGE_PATH_NOT_EXPORTED
| NodeJsErrorCode::ERR_TYPES_NOT_FOUND => false,
| NodeJsErrorCode::ERR_PACKAGE_PATH_NOT_EXPORTED => false,
NodeJsErrorCode::ERR_MODULE_NOT_FOUND
| NodeJsErrorCode::ERR_TYPES_NOT_FOUND
| NodeJsErrorCode::ERR_UNKNOWN_BUILTIN_MODULE => true,
}
}

View file

@ -0,0 +1,5 @@
{
"args": "check main.ts",
"output": "check.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
Check main.ts
TS2307 [ERROR]: Cannot find module 'package'.
at file:///[WILDLINE]/main.ts:1:22
error: Type checking failed.

View file

@ -0,0 +1,6 @@
{
"nodeModulesDir": "manual",
"imports": {
"package": "npm:package"
}
}

View file

@ -0,0 +1,2 @@
import * as pkg from "package";
console.log(pkg);

View file

@ -0,0 +1,4 @@
{
"name": "package",
"version": "1.0.0"
}

View file

@ -0,0 +1 @@
export function add(a: number, b: number): number;