From c84c747ea491bd42f11323e1a0cc54900e1146c0 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Wed, 9 Jun 2021 11:52:27 +1000 Subject: docs: improve TypeScript docs around use of libs (#10889) Closes #10881 --- docs/typescript/faqs.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/typescript/faqs.md') diff --git a/docs/typescript/faqs.md b/docs/typescript/faqs.md index 8ca9a7bff..b661cc149 100644 --- a/docs/typescript/faqs.md +++ b/docs/typescript/faqs.md @@ -52,6 +52,13 @@ that you control. You can also replace whole dependencies, using dependency of a dependency isn't being maintained or has some sort of breaking change you want to bypass while waiting for it to be updated. +### How do I write code that works in Deno and a browser, but still type checks? + +You can do this by using a `tsconfig.json` file with the `--config` option on +the command line and adjusting the `"lib"` option in the `"compilerOptions"` in +the file. For more information see +[Targeting Deno and the Browser](./configuration#targeting-deno-and-the-browser). + ### Why are you forcing me to use isolated modules, why can't I use const enums with Deno, why do I need to do export type? As of Deno 1.5 we defaulted to _isolatedModules_ to `true` and in Deno 1.6 we -- cgit v1.2.3