Use a combination of allowJs and ts-ignore, do progressive enhancement, and convert your codebase file by file. Adding any everywhere literally turns off type checking altogether codebase wide, including type inference. It also means a huge PR that’s both just noise that needs to be fixed later, and messes with your git history (good luck getting anything useful out of blame or bisect now).
Just getting a green build doesn’t mean things are okay. You’re worse off than before doing that.
I disagree that you’re worse off (the core of my comment was that even a shitty migration encourages better practices)… but I wasn’t super familiar with TS hinting - using ts-ignore would be preferable.
Personally, I mostly work in PHP and we use a similar system. Strict typing is default off so we’ve slowly propagated declare(strict_types=1); to enable compile and runtime checking on a per file basis.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
Use a combination of
allowJs
andts-ignore
, do progressive enhancement, and convert your codebase file by file. Addingany
everywhere literally turns off type checking altogether codebase wide, including type inference. It also means a huge PR that’s both just noise that needs to be fixed later, and messes with your git history (good luck getting anything useful out ofblame
orbisect
now).Just getting a green build doesn’t mean things are okay. You’re worse off than before doing that.
I disagree that you’re worse off (the core of my comment was that even a shitty migration encourages better practices)… but I wasn’t super familiar with TS hinting - using ts-ignore would be preferable.
Personally, I mostly work in PHP and we use a similar system. Strict typing is default off so we’ve slowly propagated
declare(strict_types=1);
to enable compile and runtime checking on a per file basis.