Allow using default TypeScript tooling for specific dirs/files
See original GitHub issueTo Reproduce
- Write some TypeScript code for the client, e.g.:
document.body.appendChild(document.createElement("div"))
Expected behavior
I can write client-side code inside a project where I use Deno, using TypeScript defaults (e.g. using DOM APIs).
One of the great selling points of JS on the server is that it’s possible to share client and server code. It makes a lot of sense to develop those in the same repo, but I can’t figure out how to get back the normal TypeScript dev experience for my client code folders.
Observed behaviour
VSCode gets cranky if I try to use any DOM APIs.
- All uses of the DOM API are marked as syntax errors.
- If I try to write
document.body
by hand, the editor automatically replacesdocument
withdecodeURIComponent
after I type the.
. 😫
In combination with #313, this means I’m constantly cleaning up after the Deno extension. I also lose the regular benefits of TypeScript.
Versions
macOS 10.15.7 VSCode Version: 1.52.1 Deno extension version 2.3.3
deno --version deno 1.7.1 (release, x86_64-apple-darwin) v8 8.9.255.3 typescript 4.1.3
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:27 (12 by maintainers)
Top GitHub Comments
Just want to note here that it doesn’t quite work for us (I’ve tested with Deno 1.10.1 and v3.4.0 of the extension) and that we’re not that keen on workspaces either 😄. More in https://github.com/denoland/vscode_deno/issues/264#issuecomment-839615206 but generally, we’d prefer pattern-based enabling like this:
More details in that linked comment.
We will solve this in the 3.X version of the extension by supporting workspace folders, which allows per-folder vscode settings.
Ref: https://github.com/denoland/deno/issues/8643