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:
parent
13f47ec41b
commit
ef7bc5e0a6
5 changed files with 13 additions and 0 deletions
|
@ -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(""),
|
||||||
|
});
|
||||||
|
|
2
cli/tests/testdata/declaration_header_file_with_no_exports.ts
vendored
Normal file
2
cli/tests/testdata/declaration_header_file_with_no_exports.ts
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import * as foo from "./declaration_header_file_with_no_exports_js.js";
|
||||||
|
console.log(foo);
|
0
cli/tests/testdata/declaration_header_file_with_no_exports_js.d.ts
vendored
Normal file
0
cli/tests/testdata/declaration_header_file_with_no_exports_js.d.ts
vendored
Normal file
1
cli/tests/testdata/declaration_header_file_with_no_exports_js.js
vendored
Normal file
1
cli/tests/testdata/declaration_header_file_with_no_exports_js.js
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/// <reference types="./declaration_header_file_with_no_exports_js.d.ts" />
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue