3 ms·
If your linter is TSLint, aren't you using TypeScript? That's actually my solution. I don't code directly in JS anymore; I always approach it from TypeScript.
by fixermark 8y ago
If your linter is TSLint, aren't you using TypeScript?
That's actually my solution. I don't code directly in JS anymore; I always approach it from TypeScript. I do not have time to track down bugs resulting from typos (or brain burps) causing me to mis-assign values to the wrong variables, and static typechecking coupled with variables with immutable type specifications eliminates about 80% of those instances for me.
(Going that road, backwards compatibility in JS isn't a concern for me as a web app developer, because it's pushed into the realm of "Things compiler and browser writers care about." ;) )
- sdegutis 8y agoYep, I use TypeScript for the exact same reasons. Although I've been bitten a couple times by its unsoundness (specifically with mismatched function arity in an interface) and looked briefly at ReasonML as a possible alternative. But that's more of a long term hope. TypeScript is good enough for 99% of the things I need, and great for web dev. That said, semantically it's still JS, and it still has the same flaws, like hoisting (or something having to do with const and let not being what I think they are), which still bites me every once in a while.