diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-04-11 01:12:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 01:12:51 +0200 |
commit | 8ae17026cbb30ab23fd79ac5cf5c207af5ad90a3 (patch) | |
tree | d627be6104c0903b36ac38c6b56c2603469bbfec /cli/tests/testdata | |
parent | a4eee007ef28f918db9165c52a19bc30bd65bad3 (diff) |
feat: Add "deno check" subcommand for type checking (#14072)
This commit adds new "deno check" subcommand.
Currently it is an alias for "deno cache" with the difference that remote
modules don't emit TS diagnostics by default.
Prints warning for "deno run" subcommand if "--check" flag is not present
and there's no "--no-check" flag. Adds "DENO_FUTURE_CHECK" env
variable that allows to opt into new behavior now.
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r-- | cli/tests/testdata/check_all.out | 4 | ||||
-rw-r--r-- | cli/tests/testdata/check_all.ts | 3 | ||||
-rw-r--r-- | cli/tests/testdata/future_check.ts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/future_check1.out | 3 | ||||
-rw-r--r-- | cli/tests/testdata/future_check2.out | 1 |
5 files changed, 12 insertions, 0 deletions
diff --git a/cli/tests/testdata/check_all.out b/cli/tests/testdata/check_all.out new file mode 100644 index 000000000..344264634 --- /dev/null +++ b/cli/tests/testdata/check_all.out @@ -0,0 +1,4 @@ +error: TS2322 [ERROR]: Type '12' is not assignable to type '"a"'. +export const a: "a" = 12; + ^ + at http://localhost:4545/subdir/type_error.ts:1:14 diff --git a/cli/tests/testdata/check_all.ts b/cli/tests/testdata/check_all.ts new file mode 100644 index 000000000..2ae8c2692 --- /dev/null +++ b/cli/tests/testdata/check_all.ts @@ -0,0 +1,3 @@ +import * as a from "http://localhost:4545/subdir/type_error.ts"; + +console.log(a.a); diff --git a/cli/tests/testdata/future_check.ts b/cli/tests/testdata/future_check.ts new file mode 100644 index 000000000..4d41fe06a --- /dev/null +++ b/cli/tests/testdata/future_check.ts @@ -0,0 +1 @@ +Deno.metrics(); diff --git a/cli/tests/testdata/future_check1.out b/cli/tests/testdata/future_check1.out new file mode 100644 index 000000000..9c7592fc5 --- /dev/null +++ b/cli/tests/testdata/future_check1.out @@ -0,0 +1,3 @@ +Warning In future releases `deno run` will not automatically type check without the --check flag. +To opt into this new behavior now, specify DENO_FUTURE_CHECK=1. +Check [WILDCARD]/future_check.ts diff --git a/cli/tests/testdata/future_check2.out b/cli/tests/testdata/future_check2.out new file mode 100644 index 000000000..c626a5485 --- /dev/null +++ b/cli/tests/testdata/future_check2.out @@ -0,0 +1 @@ +Check [WILDCARD]/future_check.ts |