The most common TypeScript error

preview_player
Показать описание
#shorts

Become a TypeScript Wizard with Matt's upcoming TypeScript Course:

Follow Matt on Twitter

Рекомендации по теме
Комментарии
Автор

Typescript without strict:true is not typescript

ChristofferLund
Автор

I really like this format with the cool animations and seeing you while you explain things

jorgeimo
Автор

I like it how in close captions "any" is transcribed as "enemy"

serhiibutkaliuk
Автор

I’ve seen people “use typescript”……. with any in every line

Krypton
Автор

I dont use typescript at all but i like watching people that maintain their fields
Good Luck 💪

djimi
Автор

I saw a typescript like program in progress that could auto generic these if you don’t type them with anything and then get the proper return type, just thought that was quite cool

jakob
Автор

Any in the Typescript is one of the most dangerous lies to the codebase one can imagine.

lastink
Автор

hey really informative, how did you do those animations, they look really cool

mildlymusical
Автор

Function shit(){} instead of const always for life ❤

poki
Автор

Basic common sense rules coming to "Javascript"

redcrafterlppa
Автор

Not allowing any is the true essence of typescript.

martiananomaly
Автор

Can you overload the functions by giving them different parameter types? (Even if the number of parameters stays the same)

theseangle
Автор

I wonder, if you just provided the return type to be "number", should TypeScript not simply imply that in this specific function both arguments are therefore implied to also be "number"? Of course, if the function, for example, adds the ".length" of two string parameters, then should TypeScript not simply imply that both arguments are of a type that HAS the ".type" property, so: both params will be a string OR array, etc.?

I sincerely hope that TypeScript will add more and more smart type inferences in the future. It's already getting quite clever in a lot of situations, this should be relatively harmless to add. And if it infers something wrongly, well, developers can simply give things their own types.

mahadevovnl
Автор

What tools are you using to make these videos? they look so slick

Kelz_codes
Автор

“any” should be removed from future versions of typescript. I will die on this hill

exhaustedrose
Автор

my TSConfig

/* STRICT */
"strict": true,
/* gonna include stuff that already set by "struct: true", so they don't show up in autocomplete */
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
true,
"stripInternal": true,
/* NO IMPLICIT */
"noImplicitReturns": true,
"noImplicitAny": true,
"noImplicitOverride": true,
"noImplicitThis": true,
/* NO UNUSED */
"noUnusedLocals": true,
"noUnusedParameters": true,
/* NO UNCHECKED */
"useUnknownInCatchVariables": true,
"noUncheckedIndexedAccess": true,
/* OTHER */
"preserveConstEnums": true,
"importsNotUsedAsValues": "error",
true,
/* ALLOW */
"noFallthroughCasesInSwitch": false,
false,

nomadshiba
Автор

that's one of the reasons why I prefer vanilla javascript

leokillerable