3 ms·
I wish there was some sort of "use strict-typed" or something that let you use in-browser interpreted typescript
by Gualdrapo 3mo ago
I wish there was some sort of "use strict-typed" or something that let you use in-browser interpreted typescript
- pianopatrick 3mo agoWell, you could use jsDoc to hold your types instead of writing them in typescript. The typescript compiler can still check types in jsDoc comments but you do not need a build step and the javascript you ship to the browser would be the same you write in your editor.
- hoppp 3mo agoI built some modules with jsDoc because I didn't want to have a build step but wanted type support. Works fine.
- teaearlgraycold 3mo agoIt works really really well. No one should be writing untyped JS anymore.
- satvikpendem 3mo agoJSDoc is not as powerful as TypeScript types but that might be fine for your use case. However, if you are already using tsc I don't see why you'd care about a build step, and if you care that the JS in the browser is the same as the editor, tsc can do that too without minifying and changing the JS output, merely stripping the types instead.
- zamadatix 3mo ago"use stricter";