#Import local typescript file so both Deno (LSP) and TS work?

47 messages · Page 1 of 1 (latest)

north ridge
#

Seems like Deno wants the import to end with .ts while TS wants no file extension.
Is there any way to change either of them to accept the other?

gleaming bramble
#

Maybe an auto generated import map for deno. But really why do you want this?

finite sedge
#

Use my deno2node instead of tsc

#

And Deno LSP

north ridge
gleaming bramble
#

Is it not easier to use the deno vscode extension?

north ridge
north ridge
gleaming bramble
#

You can kindly point others to use it, either through documentation or messages or .vscode/settings.json

finite sedge
#

You should develop for one runtime and transpile for the other

gleaming bramble
#

Oh yeah extensions.json my bad

north ridge
#

Not really what I'm looking for 🤔 sadly
Guess the answer is "no" in that case, unless I can generate an import map for all local files?

gleaming bramble
#

So wait, are you using deno or node?

#

You as in your project/team

north ridge
#

Project code is setup for Node.
But I'm using an editor with the Deno LSP

finite sedge
#

You should enable Deno LSP per project, not globally

gleaming bramble
#

That ummm, sounds like a bad idea

#

Why not use tsserver instead?

north ridge
#

Because I already have a decent JS/TS server installed imo

#

I get what you mean and why it's a "bad idea"

finite sedge
#

What editor are you using?

gleaming bramble
#

Deno won't work with node modules or node types

north ridge
#

but it's just a lot nicer to install the LSP with cargo and be done

gleaming bramble
#

So i think you'll run into more issues than you might expect

north ridge
#

yeah the project doesn't contain those so no problem

gleaming bramble
#

No node modules?

finite sedge
#

VSCode provides a nice out of the box experience for Node projects

north ridge
#

I know...

gleaming bramble
#

Still, built in types won't work either, nor built in modules

#

So no require, no fs

north ridge
#

I've just switched from Vs Code to helix

finite sedge
#

Create a project-specific config

#

typescript package already installs tsserver it should be able to use

north ridge
#

hmm that's a proper idea

#

aren't the core modules supported in compat mode?

gleaming bramble
#

Compat mode is no more

north ridge
gleaming bramble
#

I guess the manual is wrong

#

Or if not then it will be removed very very soon

#

Like check last message in #685193730114060300 soon

north ridge
#

interesting...

gleaming bramble
#

@north ridge btw, are you the same guy from matrix?

north ridge
#

yeah would've been a huge coincidence otherwise haha

gleaming bramble
#

Glad to see people use matrix (and sorry i didn't see it there first)