In this Hasty Treat, Scott and Wes talk about the Typescript strict
flag — what it does and why you might use it.
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 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.
02:50 - What is it?
03:26 - noImplicitAny
any
type in TypeScript is exactly that - it can be anything.infer
the type. When it can’t it will be any
.any
, but if that is the case, you must explicitly type it as any
.any
- it might be a mistake, or you forgot to type it. Risky! 06:01 - noImplicitThis
this
- it can’t be implicitly inferred. 06:47 - strictFunctionTypes
07:44 - alwaysStrict
var
variables. 09:25 - strictNullChecks
strictNullChecks
makes you check that it’s there - like an if statement. 11:18 - strictBindCallApply
12:38 - strictPropertyInitialization
13:37 - useUnknownInCatchVariables
📆 2021-09-01 15:00 / ⌛ 00:49:57
📆 2021-08-30 15:00 / ⌛ 00:24:51
📆 2021-08-25 15:00 / ⌛ 00:56:52
📆 2021-08-23 15:00 / ⌛ 00:18:51