question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow using default TypeScript tooling for specific dirs/files

See original GitHub issue

To Reproduce

  1. 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 replaces document with decodeURIComponent 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:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:27 (12 by maintainers)

github_iconTop GitHub Comments

9reactions
borekbcommented, May 12, 2021

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:

{
  "deno.enableForPaths": ["deno-scripts"]
}

More details in that linked comment.

7reactions
kitsonkcommented, Feb 11, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to turn on TypeScript strict mode in specific files
It checks marked files with strict mode and prints to the console all strict errors found. If a single strict error is found,...
Read more >
TSConfig Option: rootDirs - TypeScript
Using rootDirs , you can inform the compiler that there are many “virtual” directories acting as a single root. This allows the compiler...
Read more >
Micro Focus Fortify Static Code Analyzer User Guide
Working with MultipleTargetsand Projectsfor MSBuild Command ... Chapter 8: Translating JavaScript and TypeScript Code ... Using JMX Tools.
Read more >
[ANN] Squashfs tools 4.5 released - Linux-Kernel Archive
1.9 Mksquashfs now allows no source directory ( specified as - ) ... Create a Squashfs image from archive.tar, using defaults (gzip ......
Read more >
Javascript hacks for games. javascript coding works Log i for ...
... Let's get started To start writing our first game hack using typescript ... understand javascript learn how to use the browser dev...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found