If you have @typescript on your “Must check it out” list and aren’t sure when/how to start. I have a few tips, if you want.
Follow the
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧵" title="Thread" aria-label="Emoji: Thread">
Follow the
1: #javascript with Type-Safety
Add a `tsconfig.json` to your JS codebase and in `compilerOptions` set `allowJs` to `true`
You can incrementally adopt #typescript as you go.
Add a `tsconfig.json` to your JS codebase and in `compilerOptions` set `allowJs` to `true`
You can incrementally adopt #typescript as you go.
2: Don‘t be afraid of `any`
`any` is your escape-hatch. You give up type-safety and auto completion. So avoid it.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✨" title="Sparkles" aria-label="Emoji: Sparkles">but
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✨" title="Sparkles" aria-label="Emoji: Sparkles"> if you find yourself on one of those pickles where your code can‘t compile and you can‘t find the accurate type. Go for it. Live to fight another day.
`any` is your escape-hatch. You give up type-safety and auto completion. So avoid it.
3: Don‘t be shy of dodging integrations
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧐" title="Face with monocle" aria-label="Emoji: Face with monocle">
Certain methods are harder to strong-type than others.
Going back to step 1. Don‘t be embarrassed to elude one file while you‘re getting your feet into the water.
Certain methods are harder to strong-type than others.
Going back to step 1. Don‘t be embarrassed to elude one file while you‘re getting your feet into the water.
4: Community has your back
https://abs.twimg.com/emoji/v2/... draggable="false" alt="💪" title="Flexed biceps" aria-label="Emoji: Flexed biceps">
Even JS libs and APIs have types available on NPM. Be hesitant to reinvent the wheel and adding types to third-parties. You‘re probably a few google searches away from finding exactly what you need.
Even JS libs and APIs have types available on NPM. Be hesitant to reinvent the wheel and adding types to third-parties. You‘re probably a few google searches away from finding exactly what you need.
If this helped you, you might want to watch/subscribe to Scope Leak
https://www.youtube.com/channel/UCfCr8kE8AL0tzDPbX1KX_gg
Simplified">https://www.youtube.com/channel/U... TS is a series of short videos to get you up and running quickly and fearlessly with #TypeScript
https://abs.twimg.com/emoji/v2/... draggable="false" alt="❓" title="Red question mark ornament" aria-label="Emoji: Red question mark ornament">Did I forget something?
Let me know in the replies below!!
https://www.youtube.com/channel/UCfCr8kE8AL0tzDPbX1KX_gg
Simplified">https://www.youtube.com/channel/U... TS is a series of short videos to get you up and running quickly and fearlessly with #TypeScript
Let me know in the replies below!!
thank you @naren_dev_ for sparking the motivation to this thread!!
https://abs.twimg.com/emoji/v2/... draggable="false" alt="❤️" title="Red heart" aria-label="Emoji: Red heart">