logo
episode-header-image
Sep 2021
17m 35s

Hasty Treat - TypeScripts Strict Explain...

Wes Bos & Scott Tolinski - Full Stack Javascript Web Developers
About this episode

In this Hasty Treat, Scott and Wes talk about the Typescript strict flag — what it does and why you might use it.

Sanity - Sponsor

Sanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at sanity.io/create. Get an awesome supercharged free developer plan on sanity.io/syntax.

LogRocket - Sponsor

LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

Show Notes

02:50 - What is it?

  • Future versions of TypeScript may introduce additional stricter checking under this flag, so upgrades of TypeScript might result in new type errors in your program. When appropriate and possible, a corresponding flag will be added to disable that behavior.

03:26 - noImplicitAny

  • The any type in TypeScript is exactly that - it can be anything.
  • TypeScript will try to infer the type. When it can’t it will be any.
  • Sometimes you need any, but if that is the case, you must explicitly type it as any.
  • If something is implicitly any - it might be a mistake, or you forgot to type it. Risky!

06:01 - noImplicitThis

  • You must type this - it can’t be implicitly inferred.

06:47 - strictFunctionTypes

  • If you have a type that is a function and it doesn’t 100%.

07:44 - alwaysStrict

  • Always turns on strict mode. You can’t do things like redeclare var variables.

09:25 - strictNullChecks

  • Makes you check that the item is actually there before accessing a value or method from it.
  • Imagine you filter or find on an array, or query selector a DOM element. There is a possibility that nothing is there. strictNullChecks makes you check that it’s there - like an if statement.
  • Optional chaining is super handy here.

11:18 - strictBindCallApply

12:38 - strictPropertyInitialization

13:37 - useUnknownInCatchVariables

Links

Tweet us your tasty treats!

Up next
Jul 9
918: Extreme Native Perf on the Web with Superhuman
Wes and Scott talk with Loïc Houssier about how Superhuman builds lightning-fast, delightfully-designed email software. They dig into engineering philosophy, offline-first architecture, local databases, AI-powered productivity, and what it takes to create tools that people love. ... Show More
48m 54s
Jul 7
917: AI Tools You Should Know
Scott and Wes round up the hottest AI tools you should have on your radar; from text-to-speech wizards to self-hosted image generators. They break down what they’re using, what’s worth paying for, and which tools are changing their workflows. Show Notes 00:00 Welcome to Syntax! 0 ... Show More
37m 48s
Jul 2
916: I got fired, what should I focus on?
In this potluck episode of Syntax, Wes and Scott answer your questions about maintaining popular open-source projects, where to start after a layoff, impostor syndrome, Scott’s recording setup, whether a computer science degree is still worth it in the age of AI, and more! Show N ... Show More
58m 24s
Recommended Episodes
Jun 2022
ESLint and TypeScript
Josh Goldberg joins Nick, Chris & a very nasally-sounding KBall for a fun conversation around TypeScript ESLint. They discuss why we need ESLint when we have TypeScript, some useful rules in typescript-eslint, how it works, and a few hot takes along the way! Discuss on Changelog ... Show More
1h 3m
May 2023
The ORMazing show
Nick & KBall sit down with the brilliant Stephen Haberman to discuss all things ORMs! 💻🔍 From the advantages and disadvantages of ORMs in general, to delving into the intricacies of his innovative project Joist, which brings a fresh, idiomatic, ActiveRecord-esque approach to Ty ... Show More
1h 12m
Feb 2024
Stately with Laura Kalbag
Stately is a web-based drag and drop editor for collaboratively developing code, diagrams, and documentation. Laura Kalbag is the Developer Advocate at Stately and she joins the show today to talk about Stately, state machines, building good documentation, and more. Josh Goldberg ... Show More
1h 6m
Mar 2024
Netlify and Edge Computing with Erica Pisani
Netlify is a popular hosting platform that provides build, deploy, and serverless backend services for web apps. The platform enables deployment directly from source files stored in a version control system like GitHub. Erica Pisani is a Senior Software Engineer at Netlify. She j ... Show More
42m 16s
Jan 2024
Episode 54: White Box Formulas - Vulnerable Coding Patterns
Episode 54: In this episode of Critical Thinking - Bug Bounty Podcast Justin and Joel are back with news items and new projects. Joel shares about his personal scraping project to gather data on bug bounty programs and distribution Next, they announce the launch of HackerNotes, a ... Show More
1h 12m
Apr 2024
Netflix Engineering with Jay Phelps
Today, you can access Netflix on virtually any device. For a Netflix user, this seamless experience can be easy to take for granted, but it requires an enormous engineering effort. Jay Phelps is a Senior Software Engineer at Netflix where he works on Shared Client Foundations. He ... Show More
1h 2m
Jul 2024
Episode 78: Less Writing, More Hacking - Reporting Efficiency Techniques
Episode 78: In this episode of Critical Thinking - Bug Bounty Podcast we’re talking about writing reports. We share some tips that we’ve learned, and discuss ways that AI can (and can’t) help with that process. We also talk about the benefit of using tools like Fabric, Loom, and ... Show More
1h 6m
Jun 2024
Yet another open source rug pull (News)
A popular open source iOS authenticator app goes rogue under new ownership, Andreas Kling steps back from SerenityOS & forks Ladybird, Vhyrro takes a thought-provoking try at a “static effect system”, Matt Bessey is over GraphQL & Marc-Andre Giroux still likes GraphQL sometimes ( ... Show More
9m 47s
Jun 2024
Episode 75: *Rerun* of The OG Bug Bounty King - Frans Rosen
Episode 75: In this episode of Critical Thinking - Bug Bounty Podcast, Justin and Joel are sick, So instead of a new full episode, we're going back 30 episodes to review.Follow us on twitter at: @ctbbpodcastWe're new to this podcasting thing, so feel free to send us any feedback ... Show More
2h 44m