-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's Fix TS & Eslint #1141
Let's Fix TS & Eslint #1141
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
π¦ Changeset detectedLatest commit: b26fd81 The changes in this PR will be included in the next version bump. This PR includes changesets to release 65 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportBase: 47.94% // Head: 47.95% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #1141 +/- ##
========================================
Coverage 47.94% 47.95%
========================================
Files 691 691
Lines 30445 30456 +11
Branches 7977 7989 +12
========================================
+ Hits 14597 14605 +8
- Misses 14636 14637 +1
- Partials 1212 1214 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. β View full report at Codecov. |
Screenshots: β
There are no changes in the screenshots for this PR. If this is expected, you are good to go. |
6085c1e
to
2f8a1aa
Compare
9d4e962
to
77f68c3
Compare
5adc046
to
fb3095f
Compare
fb3095f
to
f3b4d65
Compare
β¦rt is indeed unused)
- Created a Asset type and used it instead of recreating it every time - Remove navigationParams prop in AssetRow as there was a typescript error and it was unused anyway
also remove some unneeded `params: undefined`
05f98ae
to
b26fd81
Compare
π Description
β What this PR is about
On Ledger Live Mobile:
any
explicitely is an error, not a warning.π« What this PR is NOT about
This work should be done by other teams (on the parts owned by them) later on.
There are multiple places in LLM where we seem to write code or types in a wrong - or weird - way.
We have put
// FIXME
comments there that will have to be checked by the relevant teams in the future.We also took some notes about these parts while typing the code: https://github.com/LedgerHQ/ledger-live-issues/issues/32#issuecomment-1246467565
We wrote some documentation on how to type certain parts of the app here https://github.com/LedgerHQ/ledger-live/wiki/LLM:Typescript
π Documentation
We also wrote some guides in the repository wiki about how to properly type some code parts.
β Context
We have already merged the work from #1054
LLM
+ 64 others - see changesetsβ Checklist
Maybe breaking changes... we have to carefully test this PR as some adjustment have been made while fixing the errors.
πΈ Demo
Before
After
π Expectations to reach
Zero TS errors, strict mode enabled. Clean slate on LLM typechecker
Pull Requests must pass the CI and be internally validated in order to be merged.
Bonus Round => All the WTF we found (also linked in the comment of the issue)
During our TS rework, we spotted some parts of the app that should definitely be reviewed/refactored:
src/helpers/formatAccountSearchResults.ts
=> rework without lodashreduce
andforeach
, and make sure the return type means something.react-native-redash
=> used only twice, we are using v1 (if reanimated version < 2) yet we are using reanimated v2.8.0useTheme
from@react-navigation/native
while we are supposed to have migrated to v3 using@ledgerhq/ui
, thus the migration to v3 is not finished@ledgerhq/types-live
is broken as it only declares a string. There is anotherDerivationMode
inlive-common
that is correctly typed, but we cannot import it intotypes-live
as that would break the dependency cycle. A refacto/rework is needed to migrate this type totypes-live
invariant
on application side (LLM). should we remove ?/src/components/DeviceJob/index.tsx
-> very weird types here, bunch of any and confusion on the type ofmeta
which is supposed to be a Device not a Recordobject
as a type), however I do believe a deeper understanding of the props we pass is necessary and an overview of this system is required{ value: something | null | undefined }
.{ value?: something | null }
is better, but those null checks are a pain in the ass. It should either be something or undefined