mirror of
https://github.com/denoland/deno.git
synced 2025-12-23 08:48:24 +00:00
fix(check): move types not found error to tsc diagnostic (#31509)
Closes https://github.com/denoland/deno/issues/31352
This commit is contained in:
parent
3a4b9de81e
commit
8c46ac3228
7 changed files with 25 additions and 2 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "check main.ts",
|
||||
"output": "check.out",
|
||||
"exitCode": 1
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Check main.ts
|
||||
TS2307 [ERROR]: Cannot find module 'package'.
|
||||
at file:///[WILDLINE]/main.ts:1:22
|
||||
|
||||
error: Type checking failed.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"nodeModulesDir": "manual",
|
||||
"imports": {
|
||||
"package": "npm:package"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
import * as pkg from "package";
|
||||
console.log(pkg);
|
||||
4
tests/specs/check/req_types_and_execution_not_found/node_modules/package/package.json
generated
vendored
Normal file
4
tests/specs/check/req_types_and_execution_not_found/node_modules/package/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "package",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
1
tests/specs/npm/file_specifier/package-b/index.d.ts
vendored
Normal file
1
tests/specs/npm/file_specifier/package-b/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export function add(a: number, b: number): number;
|
||||
Loading…
Add table
Add a link
Reference in a new issue