Fix TypeScript sins
Author: mifiCreated Jul 15, 2024Updated Sep 30, 2026
LabelsFeature
Pulled out from closed issue #4361
Companion
- Rewrite Companion to Typescript
- Companion options object #4355
TypeScript fixes
We have migrated parts of the codebase to typescript. But in the process we have taken some shortcuts, and in order to improve our type safety we should fix this.
- Fix all
$TSFixMe - Remove
noImplicitAny: falsefrom alltsconfig.json#6508 - Remove all
@ts-ignoreunless absolutely necessary - Remove all eslint ignore typescript rules unless absolutely necessary #6623
- maybe use strict typescript config? #6623 (its options are listed explicitly in the presets, minus those Biome covers)
- set
useUnknownInCatchVariables: true#6623 -
noImplicitOverridein all packages #6623 - tsify
private/devproject #6621 - remove most
!: ~159 outside tests, ~63 in tests - remove most
any: ~262 outside tests, ~124 in tests - remove most
as(excludingas const): ~278 outside tests, ~125 in tests - look into
@ts-expect-errorwhich don't have a good reason: ~140 outside tests, ~118 in tests - probably fixes: add
exactOptionalPropertyTypes(now recommeneded by typescript), see #6040. Enabled in the@uppy-dev/tsconfigpresets (#6508), but still opted out in 27 packages -
noUncheckedIndexedAccess: enabled in the@uppy-dev/tsconfigpresets (#6508), but still opted out in 16 packages - #6260: ~125 TS
privatekeywords left
https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html
Source: transloadit/uppy