@@ -42,6 +42,10 @@ module.exports = {
4242 'interface' ,
4343 ] ,
4444 '@typescript-eslint/no-explicit-any' : 'error' ,
45+ // Surface JSDoc @deprecated annotations at every use-site (warn for now;
46+ // ratchet to 'error' once the BN.js → BigInt migration is complete).
47+ // Pairs with the no-restricted-imports fence on app/util/number below.
48+ '@typescript-eslint/no-deprecated' : 'warn' ,
4549 // Under discussion
4650 '@typescript-eslint/no-duplicate-enum-values' : 'off' ,
4751 '@typescript-eslint/no-shadow' : [
@@ -466,8 +470,128 @@ module.exports = {
466470 } ,
467471 } ,
468472 {
469- files : [ 'app/**/*.{ts,tsx}' ] ,
470- excludedFiles : [ 'app/controllers/perps/**/*.{ts,tsx}' ] ,
473+ files : [ 'app/**/*.{ts,tsx,js,jsx}' ] ,
474+ excludedFiles : [
475+ // Perps controller is exempt from importing itself.
476+ 'app/controllers/perps/**/*.{ts,tsx}' ,
477+ // The legacy module + its tests intentionally import each other for
478+ // parity comparison.
479+ 'app/util/number/**' ,
480+ // BN.js → BigInt migration burn-down list.
481+ // Existing consumers of the deprecated `app/util/number/index.js`
482+ // module. Remove a file from this list as it is migrated to
483+ // `app/util/number/bigint`. New entries should NOT be added — that's
484+ // what the lint fence below prevents. See `app/util/number/bigint.ts`
485+ // for the replacement API and `app/util/number/bigint-migration-reference.test.ts`
486+ // for migration patterns.
487+ 'app/component-library/components-temp/CustomSpendCap/CustomInput/CustomInput.tsx' ,
488+ 'app/component-library/components-temp/CustomSpendCap/CustomSpendCap.tsx' ,
489+ 'app/component-library/components-temp/Price/AggregatedPercentage/AggregatedPercentage.tsx' ,
490+ 'app/component-library/components-temp/Price/AggregatedPercentage/utils.ts' ,
491+ 'app/components/UI/AccountInfoCard/index.js' ,
492+ 'app/components/UI/AssetOverview/Price/Price.advanced.tsx' ,
493+ 'app/components/UI/AssetOverview/Price/Price.legacy.tsx' ,
494+ 'app/components/UI/AssetOverview/utils/marketDetails.ts' ,
495+ 'app/components/UI/Bridge/components/QuoteSelectorView/QuoteRow.tsx' ,
496+ 'app/components/UI/Bridge/components/QuoteSelectorView/index.tsx' ,
497+ 'app/components/UI/Bridge/hooks/useBridgeQuoteData/index.ts' ,
498+ 'app/components/UI/Bridge/hooks/useFormattedBalanceWithThreshold/index.ts' ,
499+ 'app/components/UI/Bridge/hooks/useHasSufficientGas/index.ts' ,
500+ 'app/components/UI/Bridge/hooks/useInsufficientBalance/index.ts' ,
501+ 'app/components/UI/Bridge/hooks/useTokenBalanceInUsd/index.ts' ,
502+ 'app/components/UI/Bridge/hooks/useTokensWithBalance/index.ts' ,
503+ 'app/components/UI/Bridge/utils/exchange-rates.ts' ,
504+ 'app/components/UI/Bridge/utils/formatNetworkFee.test.ts' ,
505+ 'app/components/UI/Bridge/utils/formatNetworkFee.ts' ,
506+ 'app/components/UI/Bridge/utils/transaction-history.ts' ,
507+ 'app/components/UI/Card/hooks/useAssetBalances.tsx' ,
508+ 'app/components/UI/Card/hooks/useCardDelegation.test.ts' ,
509+ 'app/components/UI/Card/hooks/useCardDelegation.ts' ,
510+ 'app/components/UI/Card/hooks/useNeedsGasFaucet.ts' ,
511+ 'app/components/UI/Card/sdk/CardSDK.ts' ,
512+ 'app/components/UI/CollectibleOverview/index.js' ,
513+ 'app/components/UI/Earn/Views/EarnInputView/EarnInputView.test.tsx' ,
514+ 'app/components/UI/Earn/Views/EarnLendingDepositConfirmationView/components/Erc20TokenHero/index.tsx' ,
515+ 'app/components/UI/Earn/Views/EarnLendingDepositConfirmationView/index.tsx' ,
516+ 'app/components/UI/Earn/Views/EarnLendingWithdrawalConfirmationView/index.tsx' ,
517+ 'app/components/UI/Earn/Views/EarnWithdrawInputView/EarnWithdrawInputView.tsx' ,
518+ 'app/components/UI/Earn/components/EarnLendingBalance/index.tsx' ,
519+ 'app/components/UI/Earn/components/Earnings/EarningsHistory/EarningsHistory.utils.ts' ,
520+ 'app/components/UI/Earn/components/InputDisplay/InputDisplay.test.tsx' ,
521+ 'app/components/UI/Earn/hooks/useEarnGasFee.ts' ,
522+ 'app/components/UI/Earn/hooks/useEarnInput.ts' ,
523+ 'app/components/UI/Earn/hooks/useEarnings.ts' ,
524+ 'app/components/UI/Earn/hooks/useInput.ts' ,
525+ 'app/components/UI/Earn/hooks/useMultichainInputHandlers.ts' ,
526+ 'app/components/UI/Earn/hooks/useMusdBalance.ts' ,
527+ 'app/components/UI/Earn/hooks/useMusdCtaVisibility.ts' ,
528+ 'app/components/UI/Earn/utils/number.ts' ,
529+ 'app/components/UI/Earn/utils/token/index.ts' ,
530+ 'app/components/UI/Earn/utils/tron.ts' ,
531+ 'app/components/UI/HardwareWallet/AccountDetails/index.tsx' ,
532+ 'app/components/UI/Money/constants/activityStyles.ts' ,
533+ 'app/components/UI/Money/utils/moneyActivityFiat.ts' ,
534+ 'app/components/UI/MultichainBridgeTransactionListItem/MultichainBridgeTransactionListItem.tsx' ,
535+ 'app/components/UI/Notification/TransactionNotification/index.js' ,
536+ 'app/components/UI/Ramp/Aggregator/Views/BuildQuote/BuildQuote.test.tsx' ,
537+ 'app/components/UI/Ramp/Aggregator/Views/BuildQuote/BuildQuote.tsx' ,
538+ 'app/components/UI/Ramp/Aggregator/Views/OrdersList/OrdersList.tsx' ,
539+ 'app/components/UI/Ramp/Aggregator/Views/SendTransaction/SendTransaction.tsx' ,
540+ 'app/components/UI/Ramp/Aggregator/components/OrderDetails.tsx' ,
541+ 'app/components/UI/Ramp/Aggregator/components/OrderListItem/OrderListItem.tsx' ,
542+ 'app/components/UI/Ramp/Aggregator/components/Quote/Quote.tsx' ,
543+ 'app/components/UI/Ramp/Aggregator/hooks/useBalance.test.ts' ,
544+ 'app/components/UI/Ramp/Aggregator/hooks/useBalance.ts' ,
545+ 'app/components/UI/Ramp/Aggregator/hooks/useERC20GasLimitEstimation.ts' ,
546+ 'app/components/UI/Ramp/Aggregator/hooks/useHandleSuccessfulOrder.ts' ,
547+ 'app/components/UI/Ramp/Aggregator/hooks/useIntentAmount.ts' ,
548+ 'app/components/UI/Ramp/Aggregator/utils/index.ts' ,
549+ 'app/components/UI/Ramp/Deposit/utils/index.ts' ,
550+ 'app/components/UI/Ramp/utils/getOrderAmount.ts' ,
551+ 'app/components/UI/Ramp/utils/v2OrderToast.ts' ,
552+ 'app/components/UI/Stake/components/StakingBalance/StakingBanners/ClaimBanner/ClaimBanner.tsx' ,
553+ 'app/components/UI/Stake/components/StakingConfirmation/TokenValueStack/TokenValueStack.test.tsx' ,
554+ 'app/components/UI/Stake/components/StakingConfirmation/TokenValueStack/TokenValueStack.tsx' ,
555+ 'app/components/UI/Stake/components/StakingConfirmation/YouReceiveCard/YouReceiveCard.test.tsx' ,
556+ 'app/components/UI/Stake/components/StakingConfirmation/YouReceiveCard/YouReceiveCard.tsx' ,
557+ 'app/components/UI/Stake/hooks/useBalance.ts' ,
558+ 'app/components/UI/Tokens/util/deriveBalanceFromAssetMarketDetails.test.ts' ,
559+ 'app/components/UI/Tokens/util/deriveBalanceFromAssetMarketDetails.ts' ,
560+ 'app/components/UI/TransactionElement/utils-gas.js' ,
561+ 'app/components/UI/TransactionElement/utils.js' ,
562+ 'app/components/UI/UrlAutocomplete/Result.tsx' ,
563+ 'app/components/Views/AssetDetails/index.tsx' ,
564+ 'app/components/Views/DetectedTokens/components/Token.tsx' ,
565+ 'app/components/Views/GasEducationCarousel/index.js' ,
566+ 'app/components/Views/NetworksManagement/NetworkDetailsView/hooks/useNetworkValidation.ts' ,
567+ 'app/components/Views/UnifiedTransactionsView/useUnifiedTxActions.test.ts' ,
568+ 'app/components/Views/confirmations/components/gas/max-base-fee-input/max-base-fee-input.tsx' ,
569+ 'app/components/Views/confirmations/components/gas/priority-fee-input/priority-fee-input.tsx' ,
570+ 'app/components/Views/confirmations/components/info/typed-sign-v3v4/simulation/components/native-value-display/native-value-display.tsx' ,
571+ 'app/components/Views/confirmations/components/info/typed-sign-v3v4/simulation/components/value-display/value-display.tsx' ,
572+ 'app/components/Views/confirmations/components/transactions/custom-amount/custom-amount.tsx' ,
573+ 'app/components/Views/confirmations/context/send-context/utils.ts' ,
574+ 'app/components/Views/confirmations/external/staking/hooks/useStakingDetails.ts' ,
575+ 'app/components/Views/confirmations/hooks/earn/useCustomAmount.tsx' ,
576+ 'app/components/Views/confirmations/hooks/gas/useCancelSpeedupGas/useCancelSpeedupGas.ts' ,
577+ 'app/components/Views/confirmations/hooks/send/useBalance.ts' ,
578+ 'app/components/Views/confirmations/hooks/send/useCurrencyConversions.ts' ,
579+ 'app/components/Views/confirmations/hooks/send/usePercentageAmount.ts' ,
580+ 'app/components/Views/confirmations/hooks/useTokenAmount.ts' ,
581+ 'app/components/Views/confirmations/legacy/components/CustomNonceModal/index.js' ,
582+ 'app/components/Views/confirmations/legacy/components/WatchAssetRequest/index.js' ,
583+ 'app/components/Views/confirmations/utils/send.ts' ,
584+ 'app/components/hooks/useAddressBalance/useAddressBalance.ts' ,
585+ 'app/components/hooks/useGetFormattedTokensPerChain.tsx' ,
586+ 'app/components/hooks/useGetTotalFiatBalanceCrossChains.tsx' ,
587+ 'app/core/Engine/Engine.ts' ,
588+ 'app/core/Engine/controllers/gas-fee-controller/gas-fee-controller-init.test.ts' ,
589+ 'app/core/GasPolling/GasPolling.ts' ,
590+ 'app/core/NotificationManager.js' ,
591+ 'app/selectors/assets/assets-list.ts' ,
592+ 'app/selectors/earnController/earn/index.ts' ,
593+ 'app/selectors/multichain/evm.ts' ,
594+ ] ,
471595 rules : {
472596 'no-restricted-imports' : [
473597 'error' ,
@@ -478,6 +602,16 @@ module.exports = {
478602 message :
479603 'Use @metamask/perps-controller instead of relative imports into app/controllers/perps/.' ,
480604 } ,
605+ {
606+ group : [
607+ '**/util/number' ,
608+ '**/util/number/index' ,
609+ '**/app/util/number' ,
610+ '**/app/util/number/index' ,
611+ ] ,
612+ message :
613+ 'app/util/number/index.js is deprecated. Import the BigInt-based replacement from app/util/number/bigint instead. See app/util/number/bigint-migration-reference.test.ts for migration patterns.' ,
614+ } ,
481615 ] ,
482616 } ,
483617 ] ,
0 commit comments