Vscode_deno: Unclear how to indicate tsconfig to plugin

Created on 17 May 2020  路  5Comments  路  Source: denoland/vscode_deno

I'm using a tsconfig.json to add "DOM" to the lib compilerOptions for typescript, and running deno bundle -c tsconfig.json whatever.ts. I can't see any way to get the plugin to acknowledge the existing of the DOM lib though. Is this supported?

Most helpful comment

I will fix it

All 5 comments

@Ragzouken
There is an option in the configurator ("deno.tsconfig"), but it doesn鈥檛 seem to work.

I also have this problem, can someone confirm that the deno.tsconfig setting doesn't work, or if we're just doing it wrong?

I will fix it

@Ragzouken , unrelated to actually setting the tsconfig.json but related to your "dom" problem that you wanted to solve. I got it working by introducing a triple slash reference.

/// <reference lib="dom" />
document.getElementById("foo");

Edit: For compilation purposes, you also need a tsconfig.json, mine looks like this:

{
  "compilerOptions": {
    "module": "esnext",
    "target": "esnext",
    "lib": ["DOM", "DOM.Iterable", "ESNext"]
  },
  "exclude": [
    "node_modules"
  ]
}

And compile with deno bundle -c tsconfig.json file.ts file.js

The extension will automatically pick up any extensions at the root of the project called tsconfig.json. If you need an option to make this configurable, please open an issue.

Was this page helpful?
0 / 5 - 0 ratings