@NanoSector Yea.. I used it quite a lot, but trust me, it should be forbidden...
JS is too dangerous throwing errors at will and even with TS the types are unsound and more a guideline, because at runtime everything can happen, incl. undefined! Crashing the server/app!
I regret JS/TS backend services. Here, I said it.
#typescript #javascript #nodejs #node #regret #unsound #unsafe #crash #error #throw
@melroy I don’t know if that’s just a configuration issue, but that does sound a lot like my experience; I *know* this code isn’t type safe yet it still compiles, but TS goes absolutely apeshit over other minor things.
Brings me to my main issue with JS which is the ecosystem and the onion (wrapper over wrapper over wrapper…), as a backend developer who sometimes does a bit of VueJS frontend I have absolutely no clue how I should *correctly* configure my JS stack…
@delineation @NanoSector typescript warnings and errors are often valid and should be considered fixing. Yet again, typescript isn't really strictly typed. Because the code just get transpiled into js. Which can do very strange runtime things.
Eslint isn't really about safety or type safety. Eslint focuses on lining aspects. Like the amount of indentation. Luckily you do have a --fix flag with Eslint to fix almost all errors for you most of the time (automatically).
@melroy @NanoSector Honestly, I've found ESLInt to be more of an annoyance than anything.
The amount of indentation is managed by Prettier most of the time. Plus, ESLint (even with the TypeScript-specific rules) fails to recognize edge-cases.
One very annoying oversight is how it handles TSDoc imports: if you import a type only to reference it in TSDoc (think @link, or @see) it claims the type is unused -- this goes against what TypeScript says.
In this specific case, it feels a bit strange to have TypeScript saying one thing and ESLint saying something completely different.