diegodlh / zotero-cita

Cita: a Wikidata addon for Zotero with citations metadata support
GNU General Public License v3.0
235 stars 12 forks source link

Switch to typescript #171

Open dpriskorn opened 2 years ago

dpriskorn commented 2 years ago

I prefer strong typing to have better IDE experience and can lead to fewer errors in production because they are caught by the type system and validator.

Dominic-DallOsto commented 2 years ago

Yeah, this would be nice but I guess a lot of work. Is there some automated tool that would help with at least the first 90%?

Something like this maybe.

retorquere commented 2 years ago

It should in principle be possible to just rename .js to .ts and set typescript to very lax checking. After that you could slowly ratchet up the checks. TS is supposed to be a strict superset of JS -- any valid JS is by stipulation valid TS.

Switching to typescript has been a huge boon for my plugins. The typechecking has saved my bacon many a time, and you get ESNext features to boot.

jimmywarting commented 2 years ago

You might not need TypeScript... (syntax) - you can have type safety without typescript syntax

Dominic-DallOsto commented 1 year ago

Work in progress here. Just ironing out a lot of small compiler errors mostly