summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/integration/check_tests.rs6
-rw-r--r--cli/tests/integration/lsp_tests.rs2
-rw-r--r--cli/tests/testdata/check/check_dts.d.ts2
-rw-r--r--cli/tests/testdata/check/check_dts.out4
-rw-r--r--cli/tests/testdata/test/doc.out1
-rw-r--r--cli/tests/testdata/test/doc.ts2
-rw-r--r--cli/tools/check.rs6
-rw-r--r--cli/tools/test.rs1
-rw-r--r--cli/tsc/dts/lib.deno.ns.d.ts12
9 files changed, 23 insertions, 13 deletions
diff --git a/cli/tests/integration/check_tests.rs b/cli/tests/integration/check_tests.rs
index 1273fbdce..f2fe882eb 100644
--- a/cli/tests/integration/check_tests.rs
+++ b/cli/tests/integration/check_tests.rs
@@ -232,6 +232,12 @@ fn ts_no_recheck_on_redirect() {
assert!(std::str::from_utf8(&output.stderr).unwrap().is_empty());
}
+itest!(check_dts {
+ args: "check --quiet check/check_dts.d.ts",
+ output: "check/check_dts.out",
+ exit_code: 1,
+});
+
itest!(package_json_basic {
args: "check main.ts",
output: "package_json/basic/main.check.out",
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs
index bca327e96..9a62e42a3 100644
--- a/cli/tests/integration/lsp_tests.rs
+++ b/cli/tests/integration/lsp_tests.rs
@@ -1021,7 +1021,7 @@ fn lsp_hover() {
"language": "typescript",
"value": "const Deno.args: string[]"
},
- "Returns the script arguments to the program.\n\nGive the following command line invocation of Deno:\n\n```sh\ndeno run --allow-read https://deno.land/std/examples/cat.ts /etc/passwd\n```\n\nThen `Deno.args` will contain:\n\n```\n[ \"/etc/passwd\" ]\n```\n\nIf you are looking for a structured way to parse arguments, there is the\n[`std/flags`](https://deno.land/std/flags) module as part of the Deno\nstandard library.",
+ "Returns the script arguments to the program.\n\nGive the following command line invocation of Deno:\n\n```sh\ndeno run --allow-read https://deno.land/std/examples/cat.ts /etc/passwd\n```\n\nThen `Deno.args` will contain:\n\n```ts\n[ \"/etc/passwd\" ]\n```\n\nIf you are looking for a structured way to parse arguments, there is the\n[`std/flags`](https://deno.land/std/flags) module as part of the Deno\nstandard library.",
"\n\n*@category* - Runtime Environment",
],
"range": {
diff --git a/cli/tests/testdata/check/check_dts.d.ts b/cli/tests/testdata/check/check_dts.d.ts
new file mode 100644
index 000000000..9cf60f063
--- /dev/null
+++ b/cli/tests/testdata/check/check_dts.d.ts
@@ -0,0 +1,2 @@
+// TS1039 [ERROR]: Initializers are not allowed in ambient contexts.
+export const a: string = Deno.version.deno;
diff --git a/cli/tests/testdata/check/check_dts.out b/cli/tests/testdata/check/check_dts.out
new file mode 100644
index 000000000..e7ff9a009
--- /dev/null
+++ b/cli/tests/testdata/check/check_dts.out
@@ -0,0 +1,4 @@
+error: TS1039 [ERROR]: Initializers are not allowed in ambient contexts.
+export const a: string = Deno.version.deno;
+ ~~~~~~~~~~~~~~~~~
+ at file:///[WILDCARD]/check_dts.d.ts:2:26
diff --git a/cli/tests/testdata/test/doc.out b/cli/tests/testdata/test/doc.out
index 1766912e5..cd8bbb620 100644
--- a/cli/tests/testdata/test/doc.out
+++ b/cli/tests/testdata/test/doc.out
@@ -1,4 +1,3 @@
-Check [WILDCARD]/doc.ts$2-5.ts
Check [WILDCARD]/doc.ts$6-9.js
Check [WILDCARD]/doc.ts$10-13.jsx
Check [WILDCARD]/doc.ts$14-17.ts
diff --git a/cli/tests/testdata/test/doc.ts b/cli/tests/testdata/test/doc.ts
index 52fe6bdf0..519479fc5 100644
--- a/cli/tests/testdata/test/doc.ts
+++ b/cli/tests/testdata/test/doc.ts
@@ -27,7 +27,7 @@
*/
/**
- * ```
+ * ```ts
* import { check } from "./doc.ts";
*
* console.assert(check() == 42);
diff --git a/cli/tools/check.rs b/cli/tools/check.rs
index a29c4cea8..1ea8acb46 100644
--- a/cli/tools/check.rs
+++ b/cli/tools/check.rs
@@ -244,6 +244,9 @@ fn get_tsc_roots(
| MediaType::Tsx
| MediaType::Mts
| MediaType::Cts
+ | MediaType::Dts
+ | MediaType::Dmts
+ | MediaType::Dcts
| MediaType::Jsx => Some((module.specifier.clone(), module.media_type)),
MediaType::JavaScript | MediaType::Mjs | MediaType::Cjs => {
if check_js || has_ts_check(module.media_type, &module.source) {
@@ -253,9 +256,6 @@ fn get_tsc_roots(
}
}
MediaType::Json
- | MediaType::Dts
- | MediaType::Dmts
- | MediaType::Dcts
| MediaType::Wasm
| MediaType::TsBuildInfo
| MediaType::SourceMap
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index 0a0f186fb..6468da249 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -775,7 +775,6 @@ fn extract_files_from_regex_blocks(
Some(&"mts") => MediaType::Mts,
Some(&"cts") => MediaType::Cts,
Some(&"tsx") => MediaType::Tsx,
- Some(&"") => media_type,
_ => MediaType::Unknown,
}
} else {
diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts
index e3d0a75b9..ed0b00ca4 100644
--- a/cli/tsc/dts/lib.deno.ns.d.ts
+++ b/cli/tsc/dts/lib.deno.ns.d.ts
@@ -332,7 +332,7 @@ declare namespace Deno {
* ```
*
* Requires `allow-sys` permission.
- *
+ *
* On Windows there is no API available to retrieve this information and this method returns `[ 0, 0, 0 ]`.
*
* @tags allow-sys
@@ -3481,7 +3481,7 @@ declare namespace Deno {
*
* ### Truncate part of the file
*
- * ```
+ * ```ts
* const file = await Deno.makeTempFile();
* await Deno.writeFile(file, new TextEncoder().encode("Hello World"));
* await Deno.truncate(file, 7);
@@ -4095,7 +4095,7 @@ declare namespace Deno {
unref(): void;
}
- /**
+ /**
* Options which can be set when calling {@linkcode Deno.Command}.
*
* @category Sub Process
@@ -4159,7 +4159,7 @@ declare namespace Deno {
windowsRawArguments?: boolean;
}
- /**
+ /**
* @category Sub Process
*/
export interface CommandStatus {
@@ -4172,7 +4172,7 @@ declare namespace Deno {
signal: Signal | null;
}
- /**
+ /**
* The interface returned from calling {@linkcode Command.output} or
* {@linkcode Command.outputSync} which represents the result of spawning the
* child process.
@@ -4720,7 +4720,7 @@ declare namespace Deno {
*
* Then `Deno.args` will contain:
*
- * ```
+ * ```ts
* [ "/etc/passwd" ]
* ```
*