2 ms·
I also write TS. Here is my solution in my personal project that would never fly at work. In your tsconfig.json set: * alwaysStrict: true * noImplicitAny: tr
by austincheney 6y ago
I also write TS. Here is my solution in my personal project that would never fly at work.
In your tsconfig.json set:
* alwaysStrict: true
* noImplicitAny: true
* strictFunctionTypes: true
Then I go a step further and wrote my own ESLint rules to:
* eliminate classes
* eliminate this
* eliminate bind, call, and apply
* eliminate addEventListener
* eliminate try/catch
I also use typescript-eslint package to lint against the TypeScript directly.
That sounds draconian but it removes a tremendous amount complexity, laziness, and stupidity. Everything comes strongly typed without a bunch of guesswork.