summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/integration_tests.rs3
-rw-r--r--docs/getting_started/typescript.md33
-rw-r--r--std/tsconfig_test.json5
3 files changed, 15 insertions, 26 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 42172a771..cb1bb27a3 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -10,7 +10,6 @@ use test_util as util;
#[test]
fn std_tests() {
let dir = TempDir::new().expect("tempdir fail");
- let std_config = util::root_path().join("std/tsconfig_test.json");
let status = util::deno_cmd()
.env("DENO_DIR", dir.path())
.current_dir(util::root_path())
@@ -18,8 +17,6 @@ fn std_tests() {
.arg("--unstable")
.arg("--seed=86") // Some tests rely on specific random numbers.
.arg("-A")
- .arg("--config")
- .arg(std_config.to_str().unwrap())
// .arg("-Ldebug")
.arg("std/")
.spawn()
diff --git a/docs/getting_started/typescript.md b/docs/getting_started/typescript.md
index 972d42713..6aa738c88 100644
--- a/docs/getting_started/typescript.md
+++ b/docs/getting_started/typescript.md
@@ -23,23 +23,20 @@ useful when type checking is provided by your editor and you want startup time
to be as fast as possible (for example when restarting the program automatically
with a file watcher).
-Because `--no-check` does not do TypeScript type checking we can not
-automatically remove type only imports and exports as this would require type
-information. For this purpose TypeScript provides the
-[`import type` and `export type` syntax](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-exports).
-To export a type in a different file use
-`export type { AnInterface } from "./mod.ts";`. To import a type use
-`import type { AnInterface } from "./mod.ts";`. You can check that you are using
-`import type` and `export type` where necessary by setting the `isolatedModules`
-TypeScript compiler option to `true`, and the `importsNotUsedAsValues` to
-`error`. You can see an example `tsconfig.json` with this option
-[in the standard library](https://github.com/denoland/deno/blob/$CLI_VERSION/std/tsconfig_test.json).
-These settings will be enabled by default in the future. They are already the
-default in Deno 1.4 or above when using `--unstable`.
-
-Because there is no type information when using `--no-check`, `const enum` is
-not supported because it is type-directed. `--no-check` also does not support
-the legacy `import =` and `export =` syntax.
+To make the most of skipping type checks, `--no-check` transpiles each module in
+isolation without using information from imported modules. This maximizes
+potential for concurrency and incremental rebuilds. On the other hand, the
+transpiler cannot know if `export { Foo } from "./foo.ts"` should be preserved
+(in case `Foo` is a value) or removed (in case `Foo` is strictly a type). To
+resolve such ambiguities, Deno enforces
+[`isolatedModules`](https://www.typescriptlang.org/tsconfig#isolatedModules) on
+all TS code. This means that `Foo` in the above example must be a value, and the
+[`export type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-exports)
+syntax must be used instead if `Foo` is a type.
+
+Another consequence of `isolatedModules` is that the type-directed `const enum`
+is treated like `enum`. The legacy `import =` and `export =` syntaxes are also
+not supported by `--no-check`.
### Using external type definitions
@@ -90,7 +87,7 @@ definition which happens to be alongside that file, your JavaScript module named
export const foo = "foo";
```
-Deno will see this, and the compiler will use `foo.d.ts` when type checking the
+Deno will see this, and the compiler will use `foo.d.ts` when type-checking the
file, though `foo.js` will be loaded at runtime. The resolution of the value of
the directive follows the same resolution logic as importing a module, meaning
the file needs to have an extension and is relative to the current file. Remote
diff --git a/std/tsconfig_test.json b/std/tsconfig_test.json
deleted file mode 100644
index 8dee5fa2a..000000000
--- a/std/tsconfig_test.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compilerOptions": {
- "isolatedModules": true
- }
-}