1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

fix(check): ignore TS2306 (#14940)

Fixes a regression where this type checking error was being surfaced in certain scenarios.
This commit is contained in:
Nayeem Rahman 2022-06-23 17:18:32 +01:00 committed by GitHub
parent 13f47ec41b
commit ef7bc5e0a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 0 deletions

View file

@ -37,3 +37,9 @@ itest!(module_detection_force {
args: "check --quiet module_detection_force.ts", args: "check --quiet module_detection_force.ts",
output_str: Some(""), output_str: Some(""),
}); });
// Regression test for https://github.com/denoland/deno/issues/14937.
itest!(declaration_header_file_with_no_exports {
args: "check --quiet declaration_header_file_with_no_exports.ts",
output_str: Some(""),
});

View file

@ -0,0 +1,2 @@
import * as foo from "./declaration_header_file_with_no_exports_js.js";
console.log(foo);

View file

@ -0,0 +1 @@
/// <reference types="./declaration_header_file_with_no_exports_js.d.ts" />

View file

@ -188,6 +188,10 @@ delete Object.prototype.__proto__;
/** Diagnostics that are intentionally ignored when compiling TypeScript in /** Diagnostics that are intentionally ignored when compiling TypeScript in
* Deno, as they provide misleading or incorrect information. */ * Deno, as they provide misleading or incorrect information. */
const IGNORED_DIAGNOSTICS = [ const IGNORED_DIAGNOSTICS = [
// TS2306: File '.../index.d.ts' is not a module.
// We get this for `x-typescript-types` declaration files which don't export
// anything. We prefer to treat these as modules with no exports.
2306,
// TS2688: Cannot find type definition file for '...'. // TS2688: Cannot find type definition file for '...'.
// We ignore because type defintion files can end with '.ts'. // We ignore because type defintion files can end with '.ts'.
2688, 2688,