Skip to content
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

Chore: Typescript file coverage (epic) #10199

Closed
2 of 19 tasks
tommasini opened this issue Jul 1, 2024 · 0 comments · Fixed by #10746
Closed
2 of 19 tasks

Chore: Typescript file coverage (epic) #10199

tommasini opened this issue Jul 1, 2024 · 0 comments · Fixed by #10746
Assignees
Labels
release-7.30.0 Issue or pull request that will be included in release 7.30.0 team-mobile-platform type-tech-debt Technical debt

Comments

@tommasini
Copy link
Contributor

tommasini commented Jul 1, 2024

What is this about?

This issue aims to have a detailed strategy to have 100% typescript file coverage.
Converting Found 647 errors in 167 files. to 0 errors.

The following strategy to get this done without causing friction to others work will be:

  • Start to uncomment, commented lines at tsconfig.lint.json
  • Fix the flagged typescript issues by yarn lint:tsc of the following chunk of files described on the issue
  • Revert the uncommented lines at tsconfig.lint.json
  • Open a PR against the issue

Chunks of Files

Component-Library folder

 1  app/component-library/components-temp/Contracts/ContractBoxBase/ContractBoxBase.tsx:73
     1  app/component-library/components-temp/CustomSpendCap/CustomSpendCap.tsx:195
     2  app/component-library/components-temp/ListItemMultiSelectButton/ListItemMultiSelectButton.types.ts:5
     1  app/component-library/components/Accordions/Accordion/foundation/AccordionHeader/AccordionHeader.tsx:42
     1  app/component-library/components/Badges/Badge/Badge.tsx:22
     1  app/component-library/components/Badges/Badge/variants/BadgeNotifications/BadgeNotifications.stories.tsx:17
     1  app/component-library/components/BottomSheets/BottomSheet/foundation/BottomSheetDialog/BottomSheetDialog.tsx:210
     1  app/component-library/components/List/ListItemSelect/ListItemSelect.types.ts:10
     1  app/component-library/components/RadioButton/index.ts:1
     1  app/component-library/components/Select/SelectButton/foundation/SelectButtonBase.types.ts:8
     1  app/component-library/components/Select/SelectOption/SelectOption.tsx:36
     1  app/component-library/components/Select/SelectOption/SelectOption.types.ts:8
     1  app/component-library/components/Select/SelectValue/foundation/index.ts:1
     1  app/component-library/components/Sheet/SheetBottom/SheetBottom.tsx:221
     2  app/component-library/components/Toast/Toast.tsx:58

Hooks and Base folders

     1  app/components/Approvals/InstallSnapApproval/components/InstallSnapPermissionsRequest/test/InstallSnapPermissionsRequest.test.tsx:50
     2  app/components/Base/Alert.stories.tsx:31
     2  app/components/Base/Alert.tsx:144
     1  app/components/hooks/DisplayName/useTokenList.ts:3
     1  app/components/hooks/useAddressBalance/useAddressBalance.test.tsx:71
     1  app/components/hooks/useBlockExplorer.test.ts:66
     1  app/components/hooks/useBlockExplorer.ts:20
    30  app/components/hooks/useBluetoothPermissions.test.ts:54
     1  app/components/hooks/useThunkDispatch.ts:14
     1  app/components/hooks/useTokenBalance.tsx:3
     1  app/components/hooks/useTokenBalancesController/useTokenBalancesController.ts:14

UI Folder part 1

     1  app/components/UI/AccountFromToInfoCard/AccountFromToInfoCard.test.tsx:258
     1  app/components/UI/AccountRightButton/index.test.tsx:22
     1  app/components/UI/AccountSelectorList/AccountSelectorList.tsx:179
     1  app/components/UI/AddressCopy/AddressCopy.tsx:62
     1  app/components/UI/AddToAddressBookWrapper/AddToAddressBookWrapper.tsx:48
     1  app/components/UI/AssetOverview/AboutAsset/AboutAsset.tsx:32
    12  app/components/UI/AssetOverview/AssetActionButton/AssetActionButton.tsx:36
     5  app/components/UI/AssetOverview/AssetOverview.tsx:8
     2  app/components/UI/AssetOverview/Price/Price.tsx:118
     1  app/components/UI/BasicFunctionality/BasicFunctionalityModal/BasicFunctionalityModal.styles.ts:4
    10  app/components/UI/BiometryButton/BiometryButton.tsx:37
     1  app/components/UI/Bridge/utils/isBridgeAllowed.ts:36
     8  app/components/UI/ButtonReveal/index.tsx:192
     1  app/components/UI/CollectibleDetectionModal/index.tsx:67
     1  app/components/UI/CollectibleMedia/CollectibleMedia.styles.ts:11
     2  app/components/UI/CollectibleMedia/CollectibleMedia.test.tsx:34
     3  app/components/UI/CollectibleMedia/CollectibleMedia.tsx:97
     2  app/components/UI/CollectibleModal/CollectibleModal.tsx:65

UI Folder part 2

     2  app/components/UI/DeleteWalletModal/index.tsx:156
     4  app/components/UI/Drawer/index.tsx:197
     2  app/components/UI/HardwareWallet/AccountDetails/index.tsx:36
     6  app/components/UI/HardwareWallet/AccountSelector/index.tsx:85
    15  app/components/UI/LedgerModals/LedgerConfirmationModal.test.tsx:59
     1  app/components/UI/LedgerModals/LedgerTransactionModal.tsx:55
     9  app/components/UI/LedgerModals/Steps/SearchingForDeviceStep.test.tsx:27
     2  app/components/UI/LedgerModals/Steps/SearchingForDeviceStep.tsx:73
     1  app/components/UI/Name/Name.test.tsx:35
     5  app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.test.tsx:36
     4  app/components/UI/Notification/__mocks__/mock_notifications.ts:41
     3  app/components/UI/Notification/Row/Root.test.tsx:37
     9  app/components/UI/Notification/Row/Root.tsx:43
     1  app/components/UI/OnboardingWizard/index.test.tsx:23
     3  app/components/UI/OnboardingWizard/index.tsx:108
     2  app/components/UI/QRHardware/AnimatedQRScanner.tsx:248
     1  app/components/UI/QRHardware/QRSigningDetails.tsx:229

UI Folder part 3

     1  app/components/UI/Ramp/components/Account.tsx:61
     2  app/components/UI/Ramp/components/CurrencyChevron.tsx:30
     2  app/components/UI/Ramp/components/ErrorView.tsx:88
     2  app/components/UI/Ramp/components/InfoAlert.tsx:142
     2  app/components/UI/Ramp/components/Keypad.tsx:69
     4  app/components/UI/Ramp/components/modals/FiatSelectModal.tsx:168
     2  app/components/UI/Ramp/components/OrderDetails.tsx:103
     2  app/components/UI/Ramp/components/PaymentMethod.tsx:174
    16  app/components/UI/Ramp/components/PaymentMethodIcon.tsx:89
     2  app/components/UI/Ramp/components/PaymentMethodSelector.tsx:54
     2  app/components/UI/Ramp/components/Quote/Quote.tsx:154
     2  app/components/UI/Ramp/components/RegionAlert.tsx:77
     6  app/components/UI/Ramp/components/RegionModal.tsx:357
     4  app/components/UI/Ramp/components/TokenSelectModal.tsx:201
     3  app/components/UI/Ramp/hooks/useBalance.ts:46
     1  app/components/UI/Ramp/hooks/useGasPriceEstimation.test.ts:74
     1  app/components/UI/Ramp/hooks/useHandleSuccessfulOrder.ts:48
     1  app/components/UI/Ramp/sdk/index.tsx:261
     8  app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx:245

UI Folder part 4

     3  app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.test.tsx:275
     1  app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.tsx:143
    14  app/components/UI/Ramp/Views/Quotes/Quotes.tsx:146
     2  app/components/UI/Ramp/Views/Regions/Regions.tsx:185
     1  app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx:271
     2  app/components/UI/ReusableModal/index.tsx:166
     2  app/components/UI/ReviewModal/index.tsx:154
     1  app/components/UI/SearchTokenAutocomplete/index.test.tsx:27
     2  app/components/UI/SearchTokenAutocomplete/index.tsx:232
     1  app/components/UI/SimulationDetails/BalanceChangeRow/BalanceChangeRow.test.tsx:12
     1  app/components/UI/SimulationDetails/BalanceChangeRow/BalanceChangeRow.tsx:49
    10  app/components/UI/SimulationDetails/SimulationDetails.test.tsx:83
     1  app/components/UI/Swaps/SwapsLiveness.ts:20
     1  app/components/UI/Tabs/index.test.tsx:31
     1  app/components/UI/TextEstimated/TextEstimated.constants.ts:9
     4  app/components/UI/Tokens/index.tsx:13
     2  app/components/UI/TransactionElement/TransactionDetails/index.test.tsx:25
     2  app/components/UI/WarningAlert/WarningAlert.tsx:39
     2  app/components/UI/WebsiteIcon/index.test.tsx:9

Views Folder part 1

     3  app/components/Views/AccountConnect/AccountConnect.tsx:98
     2  app/components/Views/AccountPermissions/AccountPermissions.tsx:135
     1  app/components/Views/AccountPermissions/AccountPermissionsConnected/AccountPermissionsConnected.tsx:80
     2  app/components/Views/AccountPermissions/AccountPermissionsRevoke/AccountPermissionsRevoke.tsx:169
     3  app/components/Views/AddAsset/AddAsset.tsx:86
     3  app/components/Views/AssetDetails/index.tsx:273
     2  app/components/Views/BrowserUrlModal/BrowserUrlModal.tsx:105

Views Folder part 2

     1  app/components/Views/confirmations/components/ApproveTransactionHeader/ApproveTransactionHeader.tsx:131
 	 4  app/components/Views/confirmations/components/ApproveTransactionReview/AddNickname/index.tsx:208
     2  app/components/Views/confirmations/components/ApproveTransactionReview/AddNickNameHeader/index.tsx:37
     1  app/components/Views/confirmations/components/ApproveTransactionReview/index.test.tsx:71
     2  app/components/Views/confirmations/components/ApproveTransactionReview/ShowBlockExplorer/index.tsx:103
     2  app/components/Views/confirmations/components/BlockaidBanner/BlockaidBanner.stories.tsx:13
    49  app/components/Views/confirmations/components/EditGasFee1559Update/index.tsx:100
    16  app/components/Views/confirmations/components/EditGasFeeLegacyUpdate/index.tsx:139
    13  app/components/Views/confirmations/components/TransactionReview/index.test.tsx:183
    32  app/components/Views/confirmations/components/TransactionReview/TransactionReviewEIP1559Update/index.tsx:65
     4  app/components/Views/confirmations/components/TransactionReview/TransactionReviewEIP1559Update/styles.ts:7
     4  app/components/Views/confirmations/components/UpdateEIP1559Tx/index.tsx:189
     1  app/components/Views/confirmations/SendFlow/AddressElement/AddressElement.test.tsx:41
     5  app/components/Views/confirmations/SendFlow/Confirm/components/CustomGasModal/CustomGasModal.tsx:142
     2  app/components/Views/confirmations/SendFlow/WarningMessage/index.tsx:32

Views Folder part 3

     5  app/components/Views/ConnectQRHardware/index.tsx:331
     5  app/components/Views/DetectedTokens/components/Token.tsx:114
     4  app/components/Views/ImportPrivateKey/index.tsx:131
   18  app/components/Views/LedgerConnect/index.test.tsx:80
    10  app/components/Views/LedgerConnect/Scan.test.tsx:34
     4  app/components/Views/NetworkSelector/NetworkSearchTextInput/NetworkSearchTextInput.tsx:60
    10  app/components/Views/NetworkSelector/NetworkSelector.tsx:136
     1  app/components/Views/Notifications/Details/Announcements/index.tsx:47
     1  app/components/Views/Notifications/Details/Badge/index.tsx:72
     1  app/components/Views/OnboardingSuccess/index.tsx:31
     2  app/components/Views/QRScanner/index.tsx:324
     8  app/components/Views/Quiz/SRPQuiz/SRPQuiz.tsx:48
     3  app/components/Views/RevealPrivateCredential/RevealPrivateCredential.tsx:153
     2  app/components/Views/SDK/SDKSessionModal/SDKSessionModal.tsx:5
     1  app/components/Views/SDK/SDKSessionsManager/SDKSessionAccountListItem.test.tsx:113
     1  app/components/Views/SDK/SDKSessionsManager/SDKSessionItem.test.tsx:83
     1  app/components/Views/Settings/ExperimentalSettings/index.tsx:111
     2  app/components/Views/Settings/NetworksSettings/NetworkSettings/CustomNetworkView/CustomNetwork.tsx:104
     5  app/components/Views/Settings/SecuritySettings/SecuritySettings.tsx:191
     3  app/components/Views/Snaps/components/SnapDetails/test/SnapDetails.test.tsx:29
     3  app/components/Views/Snaps/components/SnapElement/test/SnapElement.test.tsx:24
     1  app/components/Views/Snaps/components/SnapPermissions/SnapPermissions.tsx:50
     2  app/components/Views/ThemeSettings/index.tsx:75
     4  app/components/Views/Wallet/index.test.tsx:152
     1  app/components/Views/Wallet/index.tsx:240

Util & Lib folders

     5  app/lib/ppom/ppom-storage-backend.ts:13
     3  app/util/blockaid/index.test.ts:45
     2  app/util/dappTransactions/index.test.ts:94
     2  app/util/dappTransactions/index.ts:81
     4  app/util/networks/index.test.ts:325
     4  app/util/notifications/methods/index.test.tsx:146
     7  app/util/smart-transactions/index.test.ts:35
     8  app/util/smart-transactions/smart-publish-hook.test.ts:147

Scenario

No response

Design

No response

Technical Details

No response

Threat Modeling Framework

No response

Acceptance Criteria

  • All typescript issue should be fixed to close this epic

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

No response

@kylanhurt kylanhurt self-assigned this Jul 10, 2024
@gauthierpetetin gauthierpetetin added the type-tech-debt Technical debt label Jul 26, 2024
@gauthierpetetin gauthierpetetin changed the title Chore: Typescript file coverage Chore: Typescript file coverage (epic) Aug 22, 2024
@metamaskbot metamaskbot added the release-7.30.0 Issue or pull request that will be included in release 7.30.0 label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-7.30.0 Issue or pull request that will be included in release 7.30.0 team-mobile-platform type-tech-debt Technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants