From 9a85a95c435968e5bdf6e71192be3ed239fd2205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 17 May 2022 23:53:42 +0200 Subject: feat: subcommands type-check only local files by default (#14623) This commit changes default mode of type-checking to "local" and adds "--check" flag to following subcommands: - deno bench - deno bundle - deno cache - deno compile - deno eval - deno install - deno test --- cli/tests/testdata/test/check_local_by_default.out | 4 ++++ cli/tests/testdata/test/check_local_by_default.ts | 3 +++ cli/tests/testdata/test/check_local_by_default2.out | 4 ++++ cli/tests/testdata/test/check_local_by_default2.ts | 6 ++++++ 4 files changed, 17 insertions(+) create mode 100644 cli/tests/testdata/test/check_local_by_default.out create mode 100644 cli/tests/testdata/test/check_local_by_default.ts create mode 100644 cli/tests/testdata/test/check_local_by_default2.out create mode 100644 cli/tests/testdata/test/check_local_by_default2.ts (limited to 'cli/tests/testdata/test') diff --git a/cli/tests/testdata/test/check_local_by_default.out b/cli/tests/testdata/test/check_local_by_default.out new file mode 100644 index 000000000..29c1bbc42 --- /dev/null +++ b/cli/tests/testdata/test/check_local_by_default.out @@ -0,0 +1,4 @@ +running 0 tests from ./test/check_local_by_default.ts + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + diff --git a/cli/tests/testdata/test/check_local_by_default.ts b/cli/tests/testdata/test/check_local_by_default.ts new file mode 100644 index 000000000..2ae8c2692 --- /dev/null +++ b/cli/tests/testdata/test/check_local_by_default.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/test/check_local_by_default2.out b/cli/tests/testdata/test/check_local_by_default2.out new file mode 100644 index 000000000..b933ac483 --- /dev/null +++ b/cli/tests/testdata/test/check_local_by_default2.out @@ -0,0 +1,4 @@ +error: TS2322 [ERROR]: Type '12' is not assignable to type '"b"'. +const b: "b" = 12; + ^ + at [WILDCARD]test/check_local_by_default2.ts:3:7 diff --git a/cli/tests/testdata/test/check_local_by_default2.ts b/cli/tests/testdata/test/check_local_by_default2.ts new file mode 100644 index 000000000..5177ff944 --- /dev/null +++ b/cli/tests/testdata/test/check_local_by_default2.ts @@ -0,0 +1,6 @@ +import * as a from "http://localhost:4545/subdir/type_error.ts"; + +const b: "b" = 12; + +console.log(a.a); +console.log(b); -- cgit v1.2.3