From 7994eb7a401b38b78826df797338f8417d8995c7 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 10 Nov 2025 13:19:50 -0330 Subject: [PATCH 1/6] chore: Fix all auto-fixable ESLint warnings Fix all auto-fixable ESLint warnings. These changes were generated by running `yarn eslint --fix`. There were a number of blank JSDoc entries added by the initial auto-fix command, which had to be reverted because the empty blocks generated errors. Aside from that, everything else ESLint recognized as auto-fixable seems to have been fixed correctly. --- eslint-warning-thresholds.json | 207 ++---------------- .../src/ApprovalController.test.ts | 2 +- .../src/ApprovalController.ts | 9 +- .../src/NftController.test.ts | 6 +- .../src/NftDetectionController.test.ts | 28 +-- .../src/NftDetectionController.ts | 103 +++++---- .../RatesController/RatesController.test.ts | 8 +- .../src/RatesController/RatesController.ts | 9 +- .../src/RatesController/types.ts | 2 +- .../NftStandards/ERC721/ERC721Standard.ts | 5 +- .../src/TokenListController.test.ts | 14 +- .../src/TokenRatesController.ts | 22 +- .../src/TokensController.test.ts | 14 +- .../src/TokensController.ts | 40 ++-- .../assets-controllers/src/assetsUtil.test.ts | 2 +- packages/assets-controllers/src/assetsUtil.ts | 48 ++-- .../crypto-compare-service/crypto-compare.ts | 6 +- .../assets-controllers/src/multicall.test.ts | 10 +- .../src/token-prices-service/codefi-v2.ts | 2 + .../base-controller/src/BaseController.ts | 4 +- packages/bridge-controller/src/types.ts | 1 - .../src/transforms/remove-fenced-code.test.ts | 4 +- .../src/transforms/remove-fenced-code.ts | 1 - .../src/ComposableController.ts | 2 +- packages/controller-utils/src/siwe.ts | 12 +- packages/controller-utils/src/types.ts | 1 + packages/controller-utils/src/util.test.ts | 2 +- packages/controller-utils/src/util.ts | 10 +- .../ens-controller/src/EnsController.test.ts | 10 +- packages/ens-controller/src/EnsController.ts | 18 +- .../src/GasFeeController.test.ts | 22 +- .../src/GasFeeController.ts | 62 ++++-- .../src/determineGasFeeCalculations.ts | 4 + .../src/createStreamMiddleware.ts | 2 +- .../src/index.test.ts | 2 +- .../tests/mocks/mockKeyring.ts | 4 +- .../src/LoggingController.test.ts | 2 +- .../src/LoggingController.ts | 2 +- .../logging-controller/src/logTypes/index.ts | 2 +- .../src/AbstractMessageManager.ts | 69 ++++-- .../src/DecryptMessageManager.ts | 30 ++- .../src/EncryptionPublicKeyManager.ts | 36 +-- packages/message-manager/src/index.ts | 2 +- ...chainMethodCallValidatorMiddleware.test.ts | 40 ++-- .../name-controller/src/NameController.ts | 8 +- .../name-controller/src/providers/ens.test.ts | 2 +- packages/name-controller/src/providers/ens.ts | 4 +- .../src/providers/etherscan.test.ts | 2 +- .../src/providers/etherscan.ts | 30 +-- .../src/providers/lens.test.ts | 2 +- .../name-controller/src/providers/lens.ts | 2 +- .../src/providers/token.test.ts | 2 +- .../name-controller/src/providers/token.ts | 2 +- packages/name-controller/src/types.ts | 2 +- packages/name-controller/src/util.ts | 2 +- .../src/NetworkController.ts | 2 +- .../tests/network-client/helpers.ts | 2 +- .../src/PermissionController.test.ts | 6 +- .../src/SubjectMetadataController.ts | 4 +- .../src/rpc-methods/getPermissions.test.ts | 2 +- .../src/rpc-methods/requestPermissions.ts | 5 +- .../src/rpc-methods/revokePermissions.test.ts | 8 +- .../src/PermissionLogController.ts | 14 +- .../permission-log-controller/src/enums.ts | 6 +- .../tests/helpers.ts | 32 +-- .../src/PhishingController.ts | 73 +++--- .../src/AbstractPollingController.ts | 8 +- .../src/BlockTrackerPollingController.ts | 4 +- .../src/StaticIntervalPollingController.ts | 2 +- .../src/RateLimitController.ts | 12 +- .../client-config-api-service.test.ts | 3 +- .../client-config-api-service.ts | 10 +- .../src/remote-feature-flag-controller.ts | 4 +- .../src/utils/user-segmentation-utils.ts | 2 + .../sample-gas-prices-service.test.ts | 2 +- .../sample-gas-prices-service.ts | 2 +- .../src/polling-with-policy.test.ts | 5 +- .../src/helpers/ResimulateHelper.ts | 1 - .../src/UserOperationController.test.ts | 6 +- .../src/UserOperationController.ts | 16 +- .../src/helpers/Bundler.test.ts | 3 +- .../src/helpers/Bundler.ts | 8 +- .../PendingUserOperationTracker.test.ts | 12 +- .../helpers/PendingUserOperationTracker.ts | 12 +- .../helpers/SnapSmartContractAccount.test.ts | 3 +- .../src/helpers/SnapSmartContractAccount.ts | 2 +- .../user-operation-controller/src/types.ts | 3 + .../src/utils/gas-fees.ts | 7 + .../src/utils/gas.test.ts | 3 +- .../src/utils/gas.ts | 2 + .../src/utils/transaction.test.ts | 2 +- .../src/utils/transaction.ts | 2 + .../src/utils/validation.test.ts | 20 +- .../src/utils/validation.ts | 10 +- scripts/create-package/cli.test.ts | 2 +- scripts/create-package/commands.test.ts | 2 +- scripts/create-package/utils.ts | 7 +- tests/fake-block-tracker.ts | 2 +- tests/fake-provider.ts | 21 +- tests/mock-network.ts | 23 +- tests/setupAfterEnv/matchers.ts | 5 +- 101 files changed, 657 insertions(+), 664 deletions(-) diff --git a/eslint-warning-thresholds.json b/eslint-warning-thresholds.json index 878c1974e90..95f8f10b4ec 100644 --- a/eslint-warning-thresholds.json +++ b/eslint-warning-thresholds.json @@ -6,12 +6,8 @@ "@typescript-eslint/no-unsafe-enum-comparison": 8 }, "packages/approval-controller/src/ApprovalController.test.ts": { - "import-x/order": 1, "jest/no-conditional-in-test": 16 }, - "packages/approval-controller/src/ApprovalController.ts": { - "@typescript-eslint/prefer-readonly": 4 - }, "packages/assets-controllers/jest.environment.js": { "n/prefer-global/text-encoder": 1, "n/prefer-global/text-decoder": 1, @@ -46,24 +42,10 @@ "@typescript-eslint/no-misused-promises": 2 }, "packages/assets-controllers/src/NftDetectionController.test.ts": { - "import-x/namespace": 6, - "import-x/order": 3 + "import-x/namespace": 6 }, "packages/assets-controllers/src/NftDetectionController.ts": { - "jsdoc/check-tag-names": 34, - "jsdoc/tag-lines": 1 - }, - "packages/assets-controllers/src/RatesController/RatesController.test.ts": { - "import-x/order": 1, - "jsdoc/tag-lines": 2 - }, - "packages/assets-controllers/src/RatesController/RatesController.ts": { - "@typescript-eslint/prefer-readonly": 1, - "import-x/order": 1, - "jsdoc/tag-lines": 3 - }, - "packages/assets-controllers/src/RatesController/types.ts": { - "import-x/order": 1 + "jsdoc/check-tag-names": 16 }, "packages/assets-controllers/src/Standards/ERC20Standard.test.ts": { "jest/no-commented-out-tests": 1 @@ -71,9 +53,6 @@ "packages/assets-controllers/src/Standards/NftStandards/ERC1155/ERC1155Standard.test.ts": { "import-x/no-named-as-default-member": 1 }, - "packages/assets-controllers/src/Standards/NftStandards/ERC721/ERC721Standard.ts": { - "prettier/prettier": 1 - }, "packages/assets-controllers/src/TokenBalancesController.ts": { "@typescript-eslint/no-misused-promises": 1 }, @@ -82,45 +61,31 @@ }, "packages/assets-controllers/src/TokenListController.test.ts": { "import-x/namespace": 7, - "import-x/order": 2, "jest/no-conditional-in-test": 2 }, "packages/assets-controllers/src/TokenRatesController.ts": { - "@typescript-eslint/prefer-readonly": 1, - "jsdoc/check-tag-names": 11 + "jsdoc/check-tag-names": 4 }, "packages/assets-controllers/src/TokensController.test.ts": { "import-x/namespace": 1, - "import-x/order": 3, "jest/no-conditional-in-test": 2 }, "packages/assets-controllers/src/TokensController.ts": { "@typescript-eslint/no-unused-vars": 1, - "@typescript-eslint/prefer-readonly": 1, - "jsdoc/check-tag-names": 10, - "jsdoc/tag-lines": 2 + "jsdoc/check-tag-names": 1 }, "packages/assets-controllers/src/assetsUtil.test.ts": { "jest/no-conditional-in-test": 2 }, - "packages/assets-controllers/src/assetsUtil.ts": { - "jsdoc/tag-lines": 2 - }, "packages/assets-controllers/src/multicall.test.ts": { "@typescript-eslint/prefer-promise-reject-errors": 2 }, - "packages/assets-controllers/src/token-prices-service/codefi-v2.ts": { - "jsdoc/tag-lines": 2 - }, "packages/base-controller/src/BaseController.test.ts": { "import-x/namespace": 13 }, "packages/bridge-status-controller/src/utils/transaction.ts": { "@typescript-eslint/no-unsafe-enum-comparison": 2 }, - "packages/build-utils/src/transforms/remove-fenced-code.test.ts": { - "import-x/order": 1 - }, "packages/build-utils/src/transforms/remove-fenced-code.ts": { "@typescript-eslint/no-unsafe-enum-comparison": 1 }, @@ -133,11 +98,7 @@ "no-shadow": 2 }, "packages/controller-utils/src/siwe.ts": { - "@typescript-eslint/no-unused-vars": 1, - "jsdoc/check-tag-names": 5 - }, - "packages/controller-utils/src/types.ts": { - "jsdoc/tag-lines": 1 + "@typescript-eslint/no-unused-vars": 1 }, "packages/controller-utils/src/util.test.ts": { "import-x/no-named-as-default": 1, @@ -153,12 +114,6 @@ "packages/eip-5792-middleware/src/hooks/processSendCalls.ts": { "@typescript-eslint/no-misused-promises": 1 }, - "packages/ens-controller/src/EnsController.test.ts": { - "import-x/order": 1 - }, - "packages/ens-controller/src/EnsController.ts": { - "jsdoc/check-tag-names": 6 - }, "packages/eth-block-tracker/src/PollingBlockTracker.test.ts": { "@typescript-eslint/unbound-method": 4 }, @@ -260,15 +215,10 @@ "jsdoc/match-description": 11 }, "packages/gas-fee-controller/src/GasFeeController.test.ts": { - "import-x/namespace": 2, - "import-x/order": 1 + "import-x/namespace": 2 }, "packages/gas-fee-controller/src/GasFeeController.ts": { - "@typescript-eslint/prefer-readonly": 1, - "jsdoc/check-tag-names": 21 - }, - "packages/gas-fee-controller/src/determineGasFeeCalculations.ts": { - "jsdoc/tag-lines": 4 + "jsdoc/check-tag-names": 1 }, "packages/json-rpc-middleware-stream/src/index.test.ts": { "@typescript-eslint/prefer-promise-reject-errors": 1, @@ -285,40 +235,21 @@ "@typescript-eslint/no-unsafe-enum-comparison": 2, "@typescript-eslint/no-unused-vars": 1 }, - "packages/keyring-controller/tests/mocks/mockKeyring.ts": { - "@typescript-eslint/prefer-readonly": 1 - }, "packages/logging-controller/src/LoggingController.test.ts": { "import-x/namespace": 1 }, - "packages/logging-controller/src/LoggingController.ts": { - "jsdoc/check-tag-names": 1 - }, - "packages/logging-controller/src/logTypes/index.ts": { - "@typescript-eslint/consistent-type-exports": 1 - }, "packages/message-manager/src/AbstractMessageManager.test.ts": { "jest/no-conditional-in-test": 7 }, "packages/message-manager/src/AbstractMessageManager.ts": { - "jsdoc/check-tag-names": 25, - "jsdoc/tag-lines": 2 + "jsdoc/check-tag-names": 1 }, "packages/message-manager/src/DecryptMessageManager.test.ts": { "jest/no-conditional-in-test": 3 }, - "packages/message-manager/src/DecryptMessageManager.ts": { - "jsdoc/check-tag-names": 11 - }, "packages/message-manager/src/EncryptionPublicKeyManager.test.ts": { "jest/no-conditional-in-test": 5 }, - "packages/message-manager/src/EncryptionPublicKeyManager.ts": { - "jsdoc/check-tag-names": 13 - }, - "packages/message-manager/src/index.ts": { - "@typescript-eslint/consistent-type-exports": 1 - }, "packages/message-manager/src/utils.ts": { "@typescript-eslint/no-unused-vars": 1 }, @@ -329,32 +260,7 @@ "@typescript-eslint/no-misused-promises": 2 }, "packages/name-controller/src/NameController.ts": { - "@typescript-eslint/no-unsafe-enum-comparison": 1, - "@typescript-eslint/prefer-readonly": 2 - }, - "packages/name-controller/src/providers/ens.test.ts": { - "import-x/order": 1 - }, - "packages/name-controller/src/providers/ens.ts": { - "@typescript-eslint/prefer-readonly": 2 - }, - "packages/name-controller/src/providers/etherscan.test.ts": { - "import-x/order": 1 - }, - "packages/name-controller/src/providers/etherscan.ts": { - "@typescript-eslint/prefer-readonly": 2 - }, - "packages/name-controller/src/providers/lens.test.ts": { - "import-x/order": 1 - }, - "packages/name-controller/src/providers/lens.ts": { - "@typescript-eslint/prefer-readonly": 1 - }, - "packages/name-controller/src/providers/token.test.ts": { - "import-x/order": 1 - }, - "packages/name-controller/src/providers/token.ts": { - "@typescript-eslint/prefer-readonly": 1 + "@typescript-eslint/no-unsafe-enum-comparison": 1 }, "packages/name-controller/src/util.ts": { "jsdoc/require-returns": 1 @@ -368,19 +274,8 @@ "packages/permission-controller/src/PermissionController.test.ts": { "jest/no-conditional-in-test": 4 }, - "packages/permission-controller/src/rpc-methods/getPermissions.test.ts": { - "import-x/order": 1 - }, - "packages/permission-controller/src/rpc-methods/requestPermissions.ts": { - "prettier/prettier": 1 - }, - "packages/permission-log-controller/src/PermissionLogController.ts": { - "@typescript-eslint/prefer-readonly": 1, - "jsdoc/check-tag-names": 2, - "jsdoc/tag-lines": 1 - }, "packages/phishing-controller/src/PhishingController.ts": { - "jsdoc/check-tag-names": 32 + "jsdoc/check-tag-names": 6 }, "packages/phishing-controller/src/utils.test.ts": { "import-x/namespace": 5 @@ -388,28 +283,9 @@ "packages/phishing-controller/src/utils.ts": { "@typescript-eslint/no-unsafe-enum-comparison": 1 }, - "packages/polling-controller/src/AbstractPollingController.ts": { - "@typescript-eslint/prefer-readonly": 1 - }, - "packages/rate-limit-controller/src/RateLimitController.ts": { - "jsdoc/check-tag-names": 4 - }, "packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.test.ts": { - "import-x/order": 1, - "jsdoc/tag-lines": 1, "promise/param-names": 1 }, - "packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.ts": { - "@typescript-eslint/prefer-readonly": 4, - "jsdoc/tag-lines": 2 - }, - "packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts": { - "@typescript-eslint/prefer-readonly": 1, - "jsdoc/check-tag-names": 2 - }, - "packages/remote-feature-flag-controller/src/utils/user-segmentation-utils.ts": { - "jsdoc/tag-lines": 2 - }, "packages/sample-controllers/src/sample-gas-prices-controller.ts": { "@typescript-eslint/no-misused-promises": 1 }, @@ -441,64 +317,12 @@ "@typescript-eslint/no-base-to-string": 1, "@typescript-eslint/no-unused-vars": 2 }, - "packages/user-operation-controller/src/UserOperationController.test.ts": { - "jsdoc/tag-lines": 4 - }, "packages/user-operation-controller/src/UserOperationController.ts": { "@typescript-eslint/prefer-promise-reject-errors": 1, - "@typescript-eslint/prefer-readonly": 3, "jsdoc/require-returns": 2 }, "packages/user-operation-controller/src/helpers/Bundler.test.ts": { - "import-x/order": 1, - "jsdoc/require-returns": 1, - "jsdoc/tag-lines": 1 - }, - "packages/user-operation-controller/src/helpers/Bundler.ts": { - "@typescript-eslint/prefer-readonly": 1, - "jsdoc/tag-lines": 2 - }, - "packages/user-operation-controller/src/helpers/PendingUserOperationTracker.test.ts": { - "import-x/order": 2, - "jsdoc/tag-lines": 4, - "prettier/prettier": 1 - }, - "packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts": { - "@typescript-eslint/prefer-readonly": 2, - "import-x/order": 1 - }, - "packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts": { - "import-x/order": 1, - "jsdoc/tag-lines": 1 - }, - "packages/user-operation-controller/src/helpers/SnapSmartContractAccount.ts": { - "@typescript-eslint/prefer-readonly": 1 - }, - "packages/user-operation-controller/src/types.ts": { - "jsdoc/tag-lines": 3 - }, - "packages/user-operation-controller/src/utils/gas-fees.ts": { - "jsdoc/tag-lines": 7 - }, - "packages/user-operation-controller/src/utils/gas.test.ts": { - "import-x/order": 1, - "jsdoc/tag-lines": 1 - }, - "packages/user-operation-controller/src/utils/gas.ts": { - "jsdoc/tag-lines": 2 - }, - "packages/user-operation-controller/src/utils/transaction.test.ts": { - "import-x/order": 1 - }, - "packages/user-operation-controller/src/utils/transaction.ts": { - "jsdoc/tag-lines": 2 - }, - "packages/user-operation-controller/src/utils/validation.test.ts": { - "import-x/order": 1, - "jsdoc/tag-lines": 2 - }, - "packages/user-operation-controller/src/utils/validation.ts": { - "jsdoc/tag-lines": 8 + "jsdoc/require-returns": 1 }, "scripts/create-package/utils.test.ts": { "@typescript-eslint/no-unsafe-enum-comparison": 3, @@ -506,21 +330,18 @@ "jest/no-conditional-in-test": 1 }, "scripts/create-package/utils.ts": { - "@typescript-eslint/no-unsafe-enum-comparison": 5, - "prettier/prettier": 1 + "@typescript-eslint/no-unsafe-enum-comparison": 5 }, "tests/fake-block-tracker.ts": { "no-empty-function": 1 }, "tests/fake-provider.ts": { "@typescript-eslint/prefer-promise-reject-errors": 1, - "@typescript-eslint/prefer-readonly": 2, - "jsdoc/check-tag-names": 12 + "jsdoc/check-tag-names": 6 }, "tests/mock-network.ts": { "@typescript-eslint/no-unsafe-enum-comparison": 1, - "@typescript-eslint/prefer-readonly": 3, - "jsdoc/check-tag-names": 10 + "jsdoc/check-tag-names": 5 }, "tests/setupAfterEnv/nock.ts": { "import-x/no-named-as-default-member": 3 diff --git a/packages/approval-controller/src/ApprovalController.test.ts b/packages/approval-controller/src/ApprovalController.test.ts index 318bd0a967c..a84b05b218f 100644 --- a/packages/approval-controller/src/ApprovalController.test.ts +++ b/packages/approval-controller/src/ApprovalController.test.ts @@ -11,7 +11,6 @@ import { import { errorCodes, JsonRpcError } from '@metamask/rpc-errors'; import { nanoid } from 'nanoid'; -import { flushPromises } from '../../../tests/helpers'; import type { AddApprovalOptions, ApprovalControllerActions, @@ -33,6 +32,7 @@ import { MissingApprovalFlowError, NoApprovalFlowsError, } from './errors'; +import { flushPromises } from '../../../tests/helpers'; jest.mock('nanoid'); diff --git a/packages/approval-controller/src/ApprovalController.ts b/packages/approval-controller/src/ApprovalController.ts index 1c5254f8e45..5a8e51277cd 100644 --- a/packages/approval-controller/src/ApprovalController.ts +++ b/packages/approval-controller/src/ApprovalController.ts @@ -369,13 +369,13 @@ export class ApprovalController extends BaseController< ApprovalControllerState, ApprovalControllerMessenger > { - #approvals: Map; + readonly #approvals: Map; - #origins: Map>; + readonly #origins: Map>; - #showApprovalRequest: () => void; + readonly #showApprovalRequest: () => void; - #typesExcludedFromRateLimiting: string[]; + readonly #typesExcludedFromRateLimiting: string[]; /** * Construct an Approval controller. @@ -616,7 +616,6 @@ export class ApprovalController extends BaseController< return Array.from( (this.#origins.get(origin) || new Map()).values(), // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands ).reduce((total, value) => total + value, 0); } diff --git a/packages/assets-controllers/src/NftController.test.ts b/packages/assets-controllers/src/NftController.test.ts index 3f61016b34b..193cf979dd5 100644 --- a/packages/assets-controllers/src/NftController.test.ts +++ b/packages/assets-controllers/src/NftController.test.ts @@ -584,7 +584,7 @@ describe('NftController', () => { ); await expect(erc721Result).rejects.toThrow( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `Suggested NFT of type ${ERC721} does not match received type ${ERC1155}`, ); }); @@ -2486,11 +2486,11 @@ describe('NftController', () => { name: 'name (directly from tokenURI)', description: 'description (directly from tokenURI)', // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + external_link: null, image: 'image (directly from tokenURI)', // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + animation_url: null, }); diff --git a/packages/assets-controllers/src/NftDetectionController.test.ts b/packages/assets-controllers/src/NftDetectionController.test.ts index 5cb89d7549e..58424bdfe22 100644 --- a/packages/assets-controllers/src/NftDetectionController.test.ts +++ b/packages/assets-controllers/src/NftDetectionController.test.ts @@ -29,6 +29,13 @@ import { import nock from 'nock'; import * as sinon from 'sinon'; +import { Source } from './constants'; +import { getDefaultNftControllerState } from './NftController'; +import { + NftDetectionController, + BlockaidResultType, + type NftDetectionControllerMessenger, +} from './NftDetectionController'; import { FakeBlockTracker } from '../../../tests/fake-block-tracker'; import { FakeProvider } from '../../../tests/fake-provider'; import { advanceTime } from '../../../tests/helpers'; @@ -37,13 +44,6 @@ import { buildMockFindNetworkClientIdByChainId, buildMockGetNetworkClientById, } from '../../network-controller/tests/helpers'; -import { Source } from './constants'; -import { getDefaultNftControllerState } from './NftController'; -import { - NftDetectionController, - BlockaidResultType, - type NftDetectionControllerMessenger, -} from './NftDetectionController'; type AllActions = MessengerActions; @@ -223,7 +223,7 @@ describe('NftDetectionController', () => { }, blockaidResult: { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: BlockaidResultType.Benign, }, }, @@ -248,7 +248,7 @@ describe('NftDetectionController', () => { }, blockaidResult: { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: BlockaidResultType.Benign, }, }, @@ -280,7 +280,7 @@ describe('NftDetectionController', () => { }, blockaidResult: { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: BlockaidResultType.Benign, }, }, @@ -322,7 +322,7 @@ describe('NftDetectionController', () => { }, blockaidResult: { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: BlockaidResultType.Malicious, }, }, @@ -344,7 +344,7 @@ describe('NftDetectionController', () => { }, blockaidResult: { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: BlockaidResultType.Benign, }, }, @@ -366,7 +366,7 @@ describe('NftDetectionController', () => { }, blockaidResult: { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: BlockaidResultType.Malicious, }, }, @@ -846,7 +846,7 @@ describe('NftDetectionController', () => { const selectedAccount = createMockInternalAccount({ address: '0x3' }); nock(NFT_API_BASE_URL) // ESLint is confused; this is a string. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + .get(`/users/${selectedAccount.address}/tokens`) .query({ continuation: '', diff --git a/packages/assets-controllers/src/NftDetectionController.ts b/packages/assets-controllers/src/NftDetectionController.ts index 30275447086..dfc55285575 100644 --- a/packages/assets-controllers/src/NftDetectionController.ts +++ b/packages/assets-controllers/src/NftDetectionController.ts @@ -75,13 +75,18 @@ const supportedNftDetectionNetworks: Set = new Set([ ]); /** - * @type ApiNft + * ApiNft * * NFT object coming from OpenSea api - * @property token_id - The NFT identifier - * @property num_sales - Number of sales - * @property background_color - The background color to be displayed with the item - * @property image_url - URI of an image associated with this NFT + * + * token_id - The NFT identifier + * + * num_sales - Number of sales + * + * background_color - The background color to be displayed with the item + * + * image_url - URI of an image associated with this NFT + * * @property image_preview_url - URI of a smaller image associated with this NFT * @property image_thumbnail_url - URI of a thumbnail image associated with this NFT * @property image_original_url - URI of the original image associated with this NFT @@ -96,54 +101,59 @@ const supportedNftDetectionNetworks: Set = new Set([ */ export type ApiNft = { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + token_id: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + num_sales: number | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + background_color: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + image_url: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + image_preview_url: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + image_thumbnail_url: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + image_original_url: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + animation_url: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + animation_original_url: string | null; name: string | null; description: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + external_link: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + asset_contract: ApiNftContract; creator: ApiNftCreator; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + last_sale: ApiNftLastSale | null; }; /** - * @type ApiNftContract + * ApiNftContract * * NFT contract object coming from OpenSea api - * @property address - Address of the NFT contract - * @property asset_contract_type - The NFT type, it could be `semi-fungible` or `non-fungible` - * @property created_date - Creation date - * @property collection - Object containing the contract name and URI of an image associated + * + * address - Address of the NFT contract + * + * asset_contract_type - The NFT type, it could be `semi-fungible` or `non-fungible` + * + * created_date - Creation date + * + * collection - Object containing the contract name and URI of an image associated + * * @property schema_name - The schema followed by the contract, it could be `ERC721` or `ERC1155` * @property symbol - The NFT contract symbol * @property total_supply - Total supply of NFTs @@ -153,63 +163,69 @@ export type ApiNft = { export type ApiNftContract = { address: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + asset_contract_type: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + created_date: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + schema_name: string | null; symbol: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + total_supply: string | null; description: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + external_link: string | null; collection: { name: string | null; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + image_url?: string | null; tokenCount?: string | null; }; }; /** - * @type ApiNftLastSale + * ApiNftLastSale * * NFT sale object coming from OpenSea api - * @property event_timestamp - Object containing a `username` - * @property total_price - URI of NFT image associated with this owner - * @property transaction - Object containing transaction_hash and block_hash + * + * event_timestamp - Object containing a `username` + * + * total_price - URI of NFT image associated with this owner + * + * transaction - Object containing transaction_hash and block_hash */ export type ApiNftLastSale = { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + event_timestamp: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + total_price: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + transaction: { transaction_hash: string; block_hash: string }; }; /** - * @type ApiNftCreator + * ApiNftCreator * * NFT creator object coming from OpenSea api - * @property user - Object containing a `username` - * @property profile_img_url - URI of NFT image associated with this owner - * @property address - The owner address + * + * user - Object containing a `username` + * + * profile_img_url - URI of NFT image associated with this owner + * + * address - The owner address */ export type ApiNftCreator = { user: { username: string }; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + profile_img_url: string; address: string; }; @@ -237,13 +253,13 @@ export type Blockaid = { contract: string; chainId: number; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + result_type: BlockaidResultType; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + malicious_score: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + attack_types: object; }; @@ -535,6 +551,7 @@ export class NftDetectionController extends BaseController< /** * Handles the state change of the preference controller. + * * @param preferencesState - The new state of the preference controller. * @param preferencesState.useNftDetection - Boolean indicating user preference on NFT detection. */ diff --git a/packages/assets-controllers/src/RatesController/RatesController.test.ts b/packages/assets-controllers/src/RatesController/RatesController.test.ts index 175dc9258f7..ecb36af1e6c 100644 --- a/packages/assets-controllers/src/RatesController/RatesController.test.ts +++ b/packages/assets-controllers/src/RatesController/RatesController.test.ts @@ -8,14 +8,14 @@ import { } from '@metamask/messenger'; import { useFakeTimers } from 'sinon'; -import type { RatesControllerMessenger, RatesControllerState } from './types'; -import { advanceTime } from '../../../../tests/helpers'; -import type { fetchMultiExchangeRate as defaultFetchExchangeRate } from '../crypto-compare-service'; import { Cryptocurrency, RatesController, name as ratesControllerName, } from './RatesController'; +import type { RatesControllerMessenger, RatesControllerState } from './types'; +import { advanceTime } from '../../../../tests/helpers'; +import type { fetchMultiExchangeRate as defaultFetchExchangeRate } from '../crypto-compare-service'; type AllActions = MessengerActions; @@ -27,6 +27,7 @@ const MOCK_TIMESTAMP = 1709983353; /** * Returns a stubbed date based on a predefined timestamp. + * * @returns The stubbed date in milliseconds. */ function getStubbedDate(): number { @@ -59,6 +60,7 @@ function buildRatesControllerMessenger( /** * Sets up and returns a new instance of RatesController with the provided configuration. + * * @param config - The configuration object for the RatesController. * @param config.interval - Polling interval. * @param config.initialState - Initial state of the controller. diff --git a/packages/assets-controllers/src/RatesController/RatesController.ts b/packages/assets-controllers/src/RatesController/RatesController.ts index 92c81c49215..cca988efb02 100644 --- a/packages/assets-controllers/src/RatesController/RatesController.ts +++ b/packages/assets-controllers/src/RatesController/RatesController.ts @@ -2,13 +2,13 @@ import { BaseController, type StateMetadata } from '@metamask/base-controller'; import { Mutex } from 'async-mutex'; import type { Draft } from 'immer'; -import { fetchMultiExchangeRate as defaultFetchExchangeRate } from '../crypto-compare-service'; import type { ConversionRates, RatesControllerState, RatesControllerOptions, RatesControllerMessenger, } from './types'; +import { fetchMultiExchangeRate as defaultFetchExchangeRate } from '../crypto-compare-service'; export const name = 'RatesController'; @@ -72,7 +72,7 @@ export class RatesController extends BaseController< readonly #includeUsdRate; - #intervalLength: number; + readonly #intervalLength: number; #intervalId: NodeJS.Timeout | undefined; @@ -120,7 +120,7 @@ export class RatesController extends BaseController< * const result = await this.#withLock(criticalLogic); */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + async #withLock(callback: () => R) { const releaseLock = await this.#mutex.acquire(); try { @@ -204,6 +204,7 @@ export class RatesController extends BaseController< /** * Returns the current list of cryptocurrency. + * * @returns The cryptocurrency list. */ getCryptocurrencyList(): Cryptocurrency[] { @@ -213,6 +214,7 @@ export class RatesController extends BaseController< /** * Sets the list of supported cryptocurrencies. + * * @param cryptocurrencies - The list of supported cryptocurrencies. */ async setCryptocurrencyList( @@ -232,6 +234,7 @@ export class RatesController extends BaseController< /** * Sets the internal fiat currency and update rates accordingly. + * * @param fiatCurrency - The fiat currency. */ async setFiatCurrency(fiatCurrency: string): Promise { diff --git a/packages/assets-controllers/src/RatesController/types.ts b/packages/assets-controllers/src/RatesController/types.ts index 49c5515391b..a78124b0197 100644 --- a/packages/assets-controllers/src/RatesController/types.ts +++ b/packages/assets-controllers/src/RatesController/types.ts @@ -4,11 +4,11 @@ import type { } from '@metamask/base-controller'; import type { Messenger } from '@metamask/messenger'; -import type { fetchMultiExchangeRate as defaultFetchExchangeRate } from '../crypto-compare-service'; import type { name as ratesControllerName, Cryptocurrency, } from './RatesController'; +import type { fetchMultiExchangeRate as defaultFetchExchangeRate } from '../crypto-compare-service'; /** * Represents the conversion rates from one currency to others, including the conversion date. diff --git a/packages/assets-controllers/src/Standards/NftStandards/ERC721/ERC721Standard.ts b/packages/assets-controllers/src/Standards/NftStandards/ERC721/ERC721Standard.ts index 431598f26e0..055da1e47d6 100644 --- a/packages/assets-controllers/src/Standards/NftStandards/ERC721/ERC721Standard.ts +++ b/packages/assets-controllers/src/Standards/NftStandards/ERC721/ERC721Standard.ts @@ -87,9 +87,8 @@ export class ERC721Standard { */ getTokenURI = async (address: string, tokenId: string): Promise => { const contract = new Contract(address, abiERC721, this.provider); - const supportsMetadata = await this.contractSupportsMetadataInterface( - address, - ); + const supportsMetadata = + await this.contractSupportsMetadataInterface(address); if (!supportsMetadata) { // Do not throw error here, supporting Metadata interface is optional even though majority of ERC721 nfts do support it. // This change is made because of instances of NFTs that are ERC404( mixed ERC20 / ERC721 implementation). diff --git a/packages/assets-controllers/src/TokenListController.test.ts b/packages/assets-controllers/src/TokenListController.test.ts index 7f1342a683f..0989b61c0c2 100644 --- a/packages/assets-controllers/src/TokenListController.test.ts +++ b/packages/assets-controllers/src/TokenListController.test.ts @@ -18,12 +18,6 @@ import type { Hex } from '@metamask/utils'; import nock from 'nock'; import * as sinon from 'sinon'; -import { advanceTime } from '../../../tests/helpers'; -import { - buildCustomNetworkClientConfiguration, - buildInfuraNetworkClientConfiguration, - buildMockGetNetworkClientById, -} from '../../network-controller/tests/helpers'; import * as tokenService from './token-service'; import type { TokenListMap, @@ -31,6 +25,12 @@ import type { TokenListControllerMessenger, } from './TokenListController'; import { TokenListController } from './TokenListController'; +import { advanceTime } from '../../../tests/helpers'; +import { + buildCustomNetworkClientConfiguration, + buildInfuraNetworkClientConfiguration, + buildMockGetNetworkClientById, +} from '../../network-controller/tests/helpers'; const namespace = 'TokenListController'; const timestamp = Date.now(); @@ -1372,7 +1372,7 @@ describe('TokenListController', () => { */ function getTokensPath(chainId: Hex) { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + return `/tokens/${convertHexToDecimal( chainId, )}?occurrenceFloor=3&includeNativeAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`; diff --git a/packages/assets-controllers/src/TokenRatesController.ts b/packages/assets-controllers/src/TokenRatesController.ts index e4791e4ee63..91dac1145f5 100644 --- a/packages/assets-controllers/src/TokenRatesController.ts +++ b/packages/assets-controllers/src/TokenRatesController.ts @@ -34,13 +34,18 @@ import type { } from './TokensController'; /** - * @type Token + * Token * * Token representation - * @property address - Hex address of the token contract - * @property decimals - Number of decimals the token uses - * @property symbol - Symbol of the token - * @property aggregators - An array containing the token's aggregators + * + * address - Hex address of the token contract + * + * decimals - Number of decimals the token uses + * + * symbol - Symbol of the token + * + * aggregators - An array containing the token's aggregators + * * @property image - Image of the token, url or bit32 image * @property hasBalanceError - 'true' if there is an error while updating the token balance * @property isERC721 - 'true' if the token is a ERC721 token @@ -120,10 +125,11 @@ export type AllowedEvents = export const controllerName = 'TokenRatesController'; /** - * @type TokenRatesState + * TokenRatesState * * Token rates controller state - * @property marketData - Market data for tokens, keyed by chain ID and then token contract address. + * + * marketData - Market data for tokens, keyed by chain ID and then token contract address. */ export type TokenRatesControllerState = { marketData: Record>; @@ -246,7 +252,7 @@ export class TokenRatesController extends StaticIntervalPollingController ({ @@ -1621,7 +1621,7 @@ describe('TokensController', () => { nock(TOKEN_END_POINT_API) .get( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `/token/${convertHexToDecimal( chainId, )}?address=${dummyTokenAddress}`, diff --git a/packages/assets-controllers/src/TokensController.ts b/packages/assets-controllers/src/TokensController.ts index 62cac130a75..3868ba74d69 100644 --- a/packages/assets-controllers/src/TokensController.ts +++ b/packages/assets-controllers/src/TokensController.ts @@ -58,13 +58,18 @@ import type { import type { Token } from './TokenRatesController'; /** - * @type SuggestedAssetMeta + * SuggestedAssetMeta * * Suggested asset by EIP747 meta data - * @property id - Generated UUID associated with this suggested asset - * @property time - Timestamp associated with this this suggested asset - * @property type - Type type this suggested asset - * @property asset - Asset suggested object + * + * id - Generated UUID associated with this suggested asset + * + * time - Timestamp associated with this this suggested asset + * + * type - Type type this suggested asset + * + * asset - Asset suggested object + * * @property interactingAddress - Account address that requested watch asset */ type SuggestedAssetMeta = { @@ -76,12 +81,15 @@ type SuggestedAssetMeta = { }; /** - * @type TokensControllerState + * TokensControllerState * * Assets controller state - * @property allTokens - Object containing tokens by network and account - * @property allIgnoredTokens - Object containing hidden/ignored tokens by network and account - * @property allDetectedTokens - Object containing tokens detected with non-zero balances + * + * allTokens - Object containing tokens by network and account + * + * allIgnoredTokens - Object containing hidden/ignored tokens by network and account + * + * allDetectedTokens - Object containing tokens detected with non-zero balances */ export type TokensControllerState = { allTokens: { [chainId: Hex]: { [key: string]: Token[] } }; @@ -185,12 +193,13 @@ export class TokensController extends BaseController< #selectedAccountId: string; - #provider: Provider; + readonly #provider: Provider; readonly #abortController: AbortController; /** * Tokens controller options + * * @param options - Constructor options. * @param options.chainId - The chain ID of the current network. * @param options.provider - Network provider. @@ -326,6 +335,7 @@ export class TokensController extends BaseController< /** * Handles the event when the network state changes. + * * @param _ - The network state. * @param patches - An array of patch operations performed on the network state. */ @@ -863,7 +873,7 @@ export class TokensController extends BaseController< if (await this.#detectIsERC721(asset.address, networkClientId)) { throw rpcErrors.invalidParams( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `Contract ${asset.address} must match type ${type}, but was detected as ${ERC721}`, ); } @@ -877,7 +887,7 @@ export class TokensController extends BaseController< if (isErc1155) { throw rpcErrors.invalidParams( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `Contract ${asset.address} must match type ${type}, but was detected as ${ERC1155}`, ); } @@ -906,7 +916,7 @@ export class TokensController extends BaseController< ) { throw rpcErrors.invalidParams( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `The symbol in the request (${asset.symbol}) does not match the symbol in the contract (${contractSymbol})`, ); } @@ -937,7 +947,7 @@ export class TokensController extends BaseController< ) { throw rpcErrors.invalidParams( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `The decimals in the request (${asset.decimals}) do not match the decimals in the contract (${contractDecimals})`, ); } @@ -947,7 +957,7 @@ export class TokensController extends BaseController< if (!Number.isInteger(decimalsNum) || decimalsNum > 36 || decimalsNum < 0) { throw rpcErrors.invalidParams( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `Invalid decimals "${decimalsStr}": must be an integer 0 <= 36`, ); } diff --git a/packages/assets-controllers/src/assetsUtil.test.ts b/packages/assets-controllers/src/assetsUtil.test.ts index f93298b44cb..824991e3f3e 100644 --- a/packages/assets-controllers/src/assetsUtil.test.ts +++ b/packages/assets-controllers/src/assetsUtil.test.ts @@ -153,7 +153,7 @@ describe('assetsUtil', () => { tokenAddress: linkTokenAddress, }); // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + const expectedValue = `https://static.cx.metamask.io/api/v1/tokenIcons/${convertHexToDecimal( ChainId.mainnet, )}/${linkTokenAddress}.png`; diff --git a/packages/assets-controllers/src/assetsUtil.ts b/packages/assets-controllers/src/assetsUtil.ts index 46f9ae22739..7e4a0e49693 100644 --- a/packages/assets-controllers/src/assetsUtil.ts +++ b/packages/assets-controllers/src/assetsUtil.ts @@ -56,6 +56,7 @@ export function compareNftMetadata(newNftMetadata: NftMetadata, nft: Nft) { /** * Checks whether the existing nft object has all the keys of the new incoming nft metadata object + * * @param newNftMetadata - New nft metadata object * @param nft - Existing nft object to compare with * @returns Whether the existing nft object has all the new keys from the new Nft metadata object @@ -130,7 +131,7 @@ export const formatIconUrlWithProxy = ({ }) => { const chainIdDecimal = convertHexToDecimal(chainId).toString(); // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + return `https://static.cx.metamask.io/api/v1/tokenIcons/${chainIdDecimal}/${tokenAddress.toLowerCase()}.png`; }; @@ -139,64 +140,64 @@ export const formatIconUrlWithProxy = ({ */ export enum SupportedTokenDetectionNetworks { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + mainnet = '0x1', // decimal: 1 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + bsc = '0x38', // decimal: 56 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + polygon = '0x89', // decimal: 137 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + avax = '0xa86a', // decimal: 43114 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + aurora = '0x4e454152', // decimal: 1313161554 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + linea_goerli = '0xe704', // decimal: 59140 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + linea_mainnet = '0xe708', // decimal: 59144 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + arbitrum = '0xa4b1', // decimal: 42161 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + optimism = '0xa', // decimal: 10 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + base = '0x2105', // decimal: 8453 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + zksync = '0x144', // decimal: 324 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + cronos = '0x19', // decimal: 25 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + celo = '0xa4ec', // decimal: 42220 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + gnosis = '0x64', // decimal: 100 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + fantom = '0xfa', // decimal: 250 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + polygon_zkevm = '0x44d', // decimal: 1101 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + moonbeam = '0x504', // decimal: 1284 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + moonriver = '0x505', // decimal: 1285 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + sei = '0x531', // decimal: 1329 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + monad_mainnet = '0x8f', // decimal: 143 } @@ -205,10 +206,10 @@ export enum SupportedTokenDetectionNetworks { */ export enum SupportedStakedBalanceNetworks { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + mainnet = '0x1', // decimal: 1 // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + hoodi = '0x88bb0', // decimal: 560048 } @@ -448,6 +449,7 @@ export async function fetchTokenContractExchangeRates({ /** * Function to search for a specific value in a given map and return the key + * * @param map - map input to search value * @param value - the value to search for * @returns returns key that corresponds to the value diff --git a/packages/assets-controllers/src/crypto-compare-service/crypto-compare.ts b/packages/assets-controllers/src/crypto-compare-service/crypto-compare.ts index 0d303713543..e933556e602 100644 --- a/packages/assets-controllers/src/crypto-compare-service/crypto-compare.ts +++ b/packages/assets-controllers/src/crypto-compare-service/crypto-compare.ts @@ -75,7 +75,7 @@ function getMultiPricingURL( * @param json.Message - The error message. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + function handleErrorResponse(json: { Response?: string; Message?: string }) { if (json.Response === 'Error') { throw new Error(json.Message); @@ -115,7 +115,7 @@ export async function fetchExchangeRate( throw new Error( `Invalid response for ${currency.toUpperCase()}: ${ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + json[currency.toUpperCase()] }`, ); @@ -123,7 +123,7 @@ export async function fetchExchangeRate( if (includeUSDRate && !Number.isFinite(usdConversionRate)) { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + throw new Error(`Invalid response for usdConversionRate: ${json.USD}`); } diff --git a/packages/assets-controllers/src/multicall.test.ts b/packages/assets-controllers/src/multicall.test.ts index a06f0f510ea..a39e61a03da 100644 --- a/packages/assets-controllers/src/multicall.test.ts +++ b/packages/assets-controllers/src/multicall.test.ts @@ -71,12 +71,12 @@ describe('multicall', () => { expect(results).toMatchObject([ { success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + value: { _hex: '0x01' }, }, { success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + value: { _hex: '0x02' }, }, ]); @@ -126,12 +126,12 @@ describe('multicall', () => { expect(results).toMatchObject([ { success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + value: { _hex: '0x01' }, }, { success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + value: { _hex: '0x02' }, }, ]); @@ -166,7 +166,7 @@ describe('multicall', () => { expect(results).toMatchObject([ { success: true, - // eslint-disable-next-line @typescript-eslint/naming-convention + value: { _hex: '0x01' }, }, ]); diff --git a/packages/assets-controllers/src/token-prices-service/codefi-v2.ts b/packages/assets-controllers/src/token-prices-service/codefi-v2.ts index 1b96e9e1aac..5ec2ddcee3c 100644 --- a/packages/assets-controllers/src/token-prices-service/codefi-v2.ts +++ b/packages/assets-controllers/src/token-prices-service/codefi-v2.ts @@ -167,6 +167,7 @@ const chainIdToNativeTokenAddress: Record = { * Returns the address that should be used to query the price api for the * chain's native token. On most chains, this is signified by the zero address. * But on some chains, the native token has a specific address. + * * @param chainId - The hexadecimal chain id. * @returns The address of the chain's native token. */ @@ -185,6 +186,7 @@ type SupportedCurrency = * The list of chain IDs that can be supplied in the URL for the `/spot-prices` * endpoint, but in hexadecimal form (for consistency with how we represent * chain IDs in other places). + * * @see Used by {@link CodefiTokenPricesServiceV2} to validate that a given chain ID is supported by V2 of the Codefi Price API. */ export const SUPPORTED_CHAIN_IDS = [ diff --git a/packages/base-controller/src/BaseController.ts b/packages/base-controller/src/BaseController.ts index 304e1886264..8a60578815b 100644 --- a/packages/base-controller/src/BaseController.ts +++ b/packages/base-controller/src/BaseController.ts @@ -41,7 +41,7 @@ export type StateChangeListener = (state: T, patches: Patch[]) => void; * @returns Something derived from controller state. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export type StateDeriver = (value: T) => Json; /** @@ -51,7 +51,7 @@ export type StateDeriver = (value: T) => Json; * get an anonymized representation of the state. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export type StateMetadata = { [P in keyof T]-?: StatePropertyMetadata; }; diff --git a/packages/bridge-controller/src/types.ts b/packages/bridge-controller/src/types.ts index cc30e8b50e5..728090aa7ab 100644 --- a/packages/bridge-controller/src/types.ts +++ b/packages/bridge-controller/src/types.ts @@ -235,7 +235,6 @@ export enum StatusTypes { export type GenericQuoteRequest = QuoteRequest< Hex | CaipChainId | string | number, // chainIds Hex | CaipAssetId | string, // assetIds/addresses - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments Hex | CaipAccountId | string // accountIds/addresses >; diff --git a/packages/build-utils/src/transforms/remove-fenced-code.test.ts b/packages/build-utils/src/transforms/remove-fenced-code.test.ts index 9c6e55d0290..b75d6de8ddb 100644 --- a/packages/build-utils/src/transforms/remove-fenced-code.test.ts +++ b/packages/build-utils/src/transforms/remove-fenced-code.test.ts @@ -1,10 +1,10 @@ -import { removeFencedCode } from '..'; -import type { FeatureLabels } from '..'; import { DirectiveCommand, multiSplice, validateCommand, } from './remove-fenced-code'; +import { removeFencedCode } from '..'; +import type { FeatureLabels } from '..'; const FEATURE_A = 'feature-a'; const FEATURE_B = 'feature-b'; diff --git a/packages/build-utils/src/transforms/remove-fenced-code.ts b/packages/build-utils/src/transforms/remove-fenced-code.ts index b0732155b47..b872989a324 100644 --- a/packages/build-utils/src/transforms/remove-fenced-code.ts +++ b/packages/build-utils/src/transforms/remove-fenced-code.ts @@ -20,7 +20,6 @@ enum DirectiveTerminus { } export enum DirectiveCommand { - // eslint-disable-next-line @typescript-eslint/naming-convention ONLY_INCLUDE_IF = 'ONLY_INCLUDE_IF', } diff --git a/packages/composable-controller/src/ComposableController.ts b/packages/composable-controller/src/ComposableController.ts index e926683eb8e..6a2d4438ee9 100644 --- a/packages/composable-controller/src/ComposableController.ts +++ b/packages/composable-controller/src/ComposableController.ts @@ -196,7 +196,7 @@ export class ComposableController< }); } catch (error: unknown) { // False negative. `name` is a string type. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + console.error(`${name} - ${String(error)}`); } } diff --git a/packages/controller-utils/src/siwe.ts b/packages/controller-utils/src/siwe.ts index cc924809429..f076313ccf5 100644 --- a/packages/controller-utils/src/siwe.ts +++ b/packages/controller-utils/src/siwe.ts @@ -37,12 +37,15 @@ function msgHexToText(hex: string): string { } /** - * @type WrappedSIWERequest + * WrappedSIWERequest * * Sign-In With Ethereum (SIWE)(EIP-4361) message with request metadata - * @property {string} from - Subject account address - * @property {string} origin - The RFC 3986 originating authority of the signing request, including scheme - * @property {ParsedMessage} siwe - The data parsed from the message + * + * from - Subject account address + * + * origin - The RFC 3986 originating authority of the signing request, including scheme + * + * siwe - The data parsed from the message */ // This interface was created before this ESLint rule was added. // Convert to a `type` in a future major version. @@ -143,7 +146,6 @@ export const isValidSIWEOrigin = (req: WrappedSIWERequest): boolean => { /** * A locally defined object used to provide data to identify a Sign-In With Ethereum (SIWE)(EIP-4361) message and provide the parsed message * - * @typedef SIWEMessage * @param {boolean} isSIWEMessage - Does the intercepted message conform to the SIWE specification? * @param {ParsedMessage} parsedMessage - The data parsed out of the message */ diff --git a/packages/controller-utils/src/types.ts b/packages/controller-utils/src/types.ts index bb7c2e3d1bf..649c36e9e60 100644 --- a/packages/controller-utils/src/types.ts +++ b/packages/controller-utils/src/types.ts @@ -219,6 +219,7 @@ export type TraceCallback = ( /** * Callback to trace. * Thrown errors will not be caught, but the trace will still be recorded. + * * @param context - The context in which the operation is running. */ fn?: (context?: TraceContext) => ReturnType, diff --git a/packages/controller-utils/src/util.test.ts b/packages/controller-utils/src/util.test.ts index 74bfee0ebd5..21af2ff1ea9 100644 --- a/packages/controller-utils/src/util.test.ts +++ b/packages/controller-utils/src/util.test.ts @@ -667,7 +667,7 @@ describe('util', () => { return cb(null, { id: params[0] }); } // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + throw new Error(`Unsupported method ${method}`); } } diff --git a/packages/controller-utils/src/util.ts b/packages/controller-utils/src/util.ts index 5fb889cd5ce..52bbe9e994d 100644 --- a/packages/controller-utils/src/util.ts +++ b/packages/controller-utils/src/util.ts @@ -70,7 +70,7 @@ export function isSafeChainId(chainId: Hex): boolean { * @returns A '0x'-prefixed hex string. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export function BNToHex(inputBn: BN | BigNumber) { return add0x(inputBn.toString(16)); } @@ -156,7 +156,7 @@ export function getBuyURL( switch (networkCode) { case '1': // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + return `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH`; case '5': return 'https://goerli-faucet.slock.it/'; @@ -300,7 +300,7 @@ function toChecksumHexAddressUnmemoized(address: string): string; * major version. Please pass a string to `toChecksumHexAddress` instead. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + function toChecksumHexAddressUnmemoized(address: T): T; // Tools only see JSDocs for overloads and ignore them for the implementation. @@ -621,7 +621,7 @@ export function isPlainObject(value: unknown): value is PlainObject { * @template T - The non-empty array member type. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export type NonEmptyArray = [T, ...T[]]; /** @@ -632,7 +632,7 @@ export type NonEmptyArray = [T, ...T[]]; * @returns Whether the value is a non-empty array. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export function isNonEmptyArray(value: T[]): value is NonEmptyArray { return Array.isArray(value) && value.length > 0; } diff --git a/packages/ens-controller/src/EnsController.test.ts b/packages/ens-controller/src/EnsController.test.ts index 8085cd6cebb..c5f3724d274 100644 --- a/packages/ens-controller/src/EnsController.test.ts +++ b/packages/ens-controller/src/EnsController.test.ts @@ -18,15 +18,15 @@ import { getDefaultNetworkControllerState, } from '@metamask/network-controller'; -import { - buildMockGetNetworkClientById, - buildCustomNetworkClientConfiguration, -} from '../../network-controller/tests/helpers'; import { EnsController, DEFAULT_ENS_NETWORK_MAP } from './EnsController'; import type { EnsControllerState, EnsControllerMessenger, } from './EnsController'; +import { + buildMockGetNetworkClientById, + buildCustomNetworkClientConfiguration, +} from '../../network-controller/tests/helpers'; const defaultState: EnsControllerState = { ensEntries: {}, @@ -50,7 +50,7 @@ jest.mock('@ethersproject/providers', () => { return { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + __esModule: true, ...originalModule, }; diff --git a/packages/ens-controller/src/EnsController.ts b/packages/ens-controller/src/EnsController.ts index 649a0fcb55c..8bdb429d465 100644 --- a/packages/ens-controller/src/EnsController.ts +++ b/packages/ens-controller/src/EnsController.ts @@ -46,12 +46,15 @@ export const DEFAULT_ENS_NETWORK_MAP: Record = { }; /** - * @type EnsEntry + * EnsEntry * * ENS entry representation - * @property chainId - Id of the associated chain - * @property ensName - The ENS name - * @property address - Hex address with the ENS name, or null + * + * chainId - Id of the associated chain + * + * ensName - The ENS name + * + * address - Hex address with the ENS name, or null */ export type EnsEntry = { chainId: Hex; @@ -60,10 +63,11 @@ export type EnsEntry = { }; /** - * @type EnsControllerState + * EnsControllerState * * ENS controller state - * @property ensEntries - Object of ENS entry objects + * + * ensEntries - Object of ENS entry objects */ export type EnsControllerState = { ensEntries: { @@ -264,7 +268,7 @@ export class EnsController extends BaseController< ) { throw new Error( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `Invalid ENS entry: { chainId:${chainId}, ensName:${ensName}, address:${address}}`, ); } diff --git a/packages/gas-fee-controller/src/GasFeeController.test.ts b/packages/gas-fee-controller/src/GasFeeController.test.ts index 562589f8064..327fdb940dd 100644 --- a/packages/gas-fee-controller/src/GasFeeController.test.ts +++ b/packages/gas-fee-controller/src/GasFeeController.test.ts @@ -21,10 +21,6 @@ import type { Hex } from '@metamask/utils'; import nock from 'nock'; import * as sinon from 'sinon'; -import { - buildCustomNetworkConfiguration, - buildCustomRpcEndpoint, -} from '../../network-controller/tests/helpers'; import determineGasFeeCalculations from './determineGasFeeCalculations'; import { fetchGasEstimates, @@ -40,6 +36,10 @@ import type { GasFeeStateFeeMarket, GasFeeStateLegacy, } from './GasFeeController'; +import { + buildCustomNetworkConfiguration, + buildCustomRpcEndpoint, +} from '../../network-controller/tests/helpers'; jest.mock('./determineGasFeeCalculations'); @@ -307,7 +307,7 @@ describe('GasFeeController', () => { getIsEIP1559Compatible?: jest.Mock>; getCurrentNetworkLegacyGasAPICompatibility?: jest.Mock; legacyAPIEndpoint?: string; - // eslint-disable-next-line @typescript-eslint/naming-convention + EIP1559APIEndpoint?: string; clientId?: string; networkControllerState?: Partial; @@ -1100,13 +1100,13 @@ describe('GasFeeController', () => { isLegacyGasAPICompatible: false, fetchGasEstimates, // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + fetchGasEstimatesUrl: `https://some-eip-1559-endpoint/${convertHexToDecimal( ChainId.sepolia, )}`, fetchLegacyGasPriceEstimates, // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + fetchLegacyGasPriceEstimatesUrl: `https://some-legacy-endpoint/${convertHexToDecimal( ChainId.sepolia, )}`, @@ -1211,7 +1211,7 @@ describe('GasFeeController', () => { expect(mockedDetermineGasFeeCalculations).toHaveBeenCalledWith( expect.objectContaining({ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + fetchGasEstimatesUrl: `http://eip-1559.endpoint/${convertHexToDecimal( ChainId.sepolia, )}`, @@ -1259,7 +1259,7 @@ describe('GasFeeController', () => { 1, expect.objectContaining({ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + fetchGasEstimatesUrl: `https://some-eip-1559-endpoint/${convertHexToDecimal( ChainId['linea-sepolia'], )}`, @@ -1272,7 +1272,7 @@ describe('GasFeeController', () => { 2, expect.objectContaining({ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + fetchGasEstimatesUrl: `https://some-eip-1559-endpoint/${convertHexToDecimal( ChainId['linea-sepolia'], )}`, @@ -1291,7 +1291,7 @@ describe('GasFeeController', () => { expect(mockedDetermineGasFeeCalculations).toHaveBeenCalledWith( expect.objectContaining({ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + fetchGasEstimatesUrl: `https://some-eip-1559-endpoint/${convertHexToDecimal( ChainId.sepolia, )}`, diff --git a/packages/gas-fee-controller/src/GasFeeController.ts b/packages/gas-fee-controller/src/GasFeeController.ts index 30b0822667e..508b68c4efd 100644 --- a/packages/gas-fee-controller/src/GasFeeController.ts +++ b/packages/gas-fee-controller/src/GasFeeController.ts @@ -34,7 +34,7 @@ import { export const LEGACY_GAS_PRICES_API_URL = `https://api.metaswap.codefi.network/gasPrices`; // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export type unknownString = 'unknown'; // Fee Market describes the way gas is set after the london hardfork, and was @@ -78,12 +78,13 @@ export type EstimatedGasFeeTimeBounds = { }; /** - * @type EthGasPriceEstimate + * EthGasPriceEstimate * * A single gas price estimate for networks and accounts that don't support EIP-1559 * This estimate comes from eth_gasPrice but is converted to dec gwei to match other * return values - * @property gasPrice - A GWEI dec string + * + * gasPrice - A GWEI dec string */ export type EthGasPriceEstimate = { @@ -91,14 +92,17 @@ export type EthGasPriceEstimate = { }; /** - * @type LegacyGasPriceEstimate + * LegacyGasPriceEstimate * * A set of gas price estimates for networks and accounts that don't support EIP-1559 * These estimates include low, medium and high all as strings representing gwei in * decimal format. - * @property high - gasPrice, in decimal gwei string format, suggested for fast inclusion - * @property medium - gasPrice, in decimal gwei string format, suggested for avg inclusion - * @property low - gasPrice, in decimal gwei string format, suggested for slow inclusion + * + * high - gasPrice, in decimal gwei string format, suggested for fast inclusion + * + * medium - gasPrice, in decimal gwei string format, suggested for avg inclusion + * + * low - gasPrice, in decimal gwei string format, suggested for slow inclusion */ export type LegacyGasPriceEstimate = { high: string; @@ -107,13 +111,17 @@ export type LegacyGasPriceEstimate = { }; /** - * @type Eip1559GasFee + * Eip1559GasFee * * Data necessary to provide an estimate of a gas fee with a specific tip - * @property minWaitTimeEstimate - The fastest the transaction will take, in milliseconds - * @property maxWaitTimeEstimate - The slowest the transaction will take, in milliseconds - * @property suggestedMaxPriorityFeePerGas - A suggested "tip", a GWEI hex number - * @property suggestedMaxFeePerGas - A suggested max fee, the most a user will pay. a GWEI hex number + * + * minWaitTimeEstimate - The fastest the transaction will take, in milliseconds + * + * maxWaitTimeEstimate - The slowest the transaction will take, in milliseconds + * + * suggestedMaxPriorityFeePerGas - A suggested "tip", a GWEI hex number + * + * suggestedMaxFeePerGas - A suggested max fee, the most a user will pay. a GWEI hex number */ export type Eip1559GasFee = { minWaitTimeEstimate: number; // a time duration in milliseconds @@ -123,13 +131,18 @@ export type Eip1559GasFee = { }; /** - * @type GasFeeEstimates + * GasFeeEstimates * * Data necessary to provide multiple GasFee estimates, and supporting information, to the user - * @property low - A GasFee for a minimum necessary combination of tip and maxFee - * @property medium - A GasFee for a recommended combination of tip and maxFee - * @property high - A GasFee for a high combination of tip and maxFee - * @property estimatedBaseFee - An estimate of what the base fee will be for the pending/next block. A GWEI dec number + * + * low - A GasFee for a minimum necessary combination of tip and maxFee + * + * medium - A GasFee for a recommended combination of tip and maxFee + * + * high - A GasFee for a high combination of tip and maxFee + * + * estimatedBaseFee - An estimate of what the base fee will be for the pending/next block. A GWEI dec number + * * @property networkCongestion - A normalized number that can be used to gauge the congestion * level of the network, with 0 meaning not congested and 1 meaning extremely congested */ @@ -224,11 +237,13 @@ export type FetchGasFeeEstimateOptions = { }; /** - * @type GasFeeState + * GasFeeState * * Gas Fee controller state - * @property gasFeeEstimates - Gas fee estimate data based on new EIP-1559 properties - * @property estimatedGasFeeTimeBounds - Estimates representing the minimum and maximum + * + * gasFeeEstimates - Gas fee estimate data based on new EIP-1559 properties + * + * estimatedGasFeeTimeBounds - Estimates representing the minimum and maximum */ export type SingleChainGasFeeState = | GasFeeStateEthGasPrice @@ -299,7 +314,7 @@ export class GasFeeController extends StaticIntervalPollingController ProviderProxy; + readonly #getProvider: () => ProviderProxy; /** * Creates a GasFeeController instance. @@ -363,7 +378,7 @@ export class GasFeeController extends StaticIntervalPollingController ProviderProxy; onNetworkDidChange?: (listener: (state: NetworkState) => void) => void; legacyAPIEndpoint?: string; - // eslint-disable-next-line @typescript-eslint/naming-convention + EIP1559APIEndpoint: string; clientId?: string; }) { @@ -585,7 +600,6 @@ export class GasFeeController extends StaticIntervalPollingController new Promise((resolve) => setTimeout(resolve, time)); // TODO: Replace `any` with type -// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-explicit-any +// eslint-disable-next-line @typescript-eslint/no-explicit-any const noop = function (_a: any) {}; const jsonrpc = '2.0' as const; diff --git a/packages/keyring-controller/tests/mocks/mockKeyring.ts b/packages/keyring-controller/tests/mocks/mockKeyring.ts index 7d8b9ab1265..e1d59417610 100644 --- a/packages/keyring-controller/tests/mocks/mockKeyring.ts +++ b/packages/keyring-controller/tests/mocks/mockKeyring.ts @@ -6,10 +6,10 @@ export class MockKeyring implements EthKeyring { public type = 'Mock Keyring'; - #accounts: Hex[] = []; + readonly #accounts: Hex[] = []; constructor(options: Record | undefined = {}) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises, @typescript-eslint/promise-function-async + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.deserialize(options); } diff --git a/packages/logging-controller/src/LoggingController.test.ts b/packages/logging-controller/src/LoggingController.test.ts index ccf0938cdf4..a1123499500 100644 --- a/packages/logging-controller/src/LoggingController.test.ts +++ b/packages/logging-controller/src/LoggingController.test.ts @@ -16,7 +16,7 @@ import { SigningMethod, SigningStage } from './logTypes/EthSignLog'; jest.mock('uuid', () => { return { // We need to use this name as this is what Jest recognizes. - // eslint-disable-next-line @typescript-eslint/naming-convention + __esModule: true, ...jest.requireActual('uuid'), }; diff --git a/packages/logging-controller/src/LoggingController.ts b/packages/logging-controller/src/LoggingController.ts index 05f8e092832..07efef2cb2b 100644 --- a/packages/logging-controller/src/LoggingController.ts +++ b/packages/logging-controller/src/LoggingController.ts @@ -23,7 +23,7 @@ export type LogEntry = { /** * Logging controller state * - * @property logs - An object of logs indexed by their ids + * logs - An object of logs indexed by their ids */ export type LoggingControllerState = { logs: { diff --git a/packages/logging-controller/src/logTypes/index.ts b/packages/logging-controller/src/logTypes/index.ts index 48239f262c5..e34adbc63a8 100644 --- a/packages/logging-controller/src/logTypes/index.ts +++ b/packages/logging-controller/src/logTypes/index.ts @@ -10,5 +10,5 @@ export type Log = EthSignLog | GenericLog; * Export all other types from these files for usage by clients */ export * from './EthSignLog'; -export * from './GenericLog'; +export type * from './GenericLog'; export * from './LogType'; diff --git a/packages/message-manager/src/AbstractMessageManager.ts b/packages/message-manager/src/AbstractMessageManager.ts index d820246136e..7cfa3e7ae11 100644 --- a/packages/message-manager/src/AbstractMessageManager.ts +++ b/packages/message-manager/src/AbstractMessageManager.ts @@ -37,10 +37,11 @@ const getDefaultState = () => ({ }); /** - * @type OriginalRequest + * OriginalRequest * * Represents the original request object for adding a message. - * @property origin? - Is it is specified, represents the origin + * + * origin? - Is it is specified, represents the origin */ export type OriginalRequest = { id?: number; @@ -49,14 +50,19 @@ export type OriginalRequest = { }; /** - * @type AbstractMessage + * AbstractMessage * * Represents and contains data about a signing type signature request. - * @property id - An id to track and identify the message object - * @property type - The json-prc signing method for which a signature request has been made. + * + * id - An id to track and identify the message object + * + * type - The json-prc signing method for which a signature request has been made. * A 'Message' which always has a signing type - * @property rawSig - Raw data of the signature request - * @property securityProviderResponse - Response from a security provider, whether it is malicious or not + * + * rawSig - Raw data of the signature request + * + * securityProviderResponse - Response from a security provider, whether it is malicious or not + * * @property metadata - Additional data for the message, for example external identifiers */ export type AbstractMessage = { @@ -72,13 +78,17 @@ export type AbstractMessage = { }; /** - * @type AbstractMessageParams + * AbstractMessageParams * * Represents the parameters to pass to the signing method once the signature request is approved. - * @property from - Address from which the message is processed - * @property origin? - Added for request origin identification - * @property requestId? - Original request id - * @property deferSetAsSigned? - Whether to defer setting the message as signed immediately after the keyring is told to sign it + * + * from - Address from which the message is processed + * + * origin? - Added for request origin identification + * + * requestId? - Original request id + * + * deferSetAsSigned? - Whether to defer setting the message as signed immediately after the keyring is told to sign it */ export type AbstractMessageParams = { from: string; @@ -88,24 +98,29 @@ export type AbstractMessageParams = { }; /** - * @type MessageParamsMetamask + * MessageParamsMetamask * * Represents the parameters to pass to the signing method once the signature request is approved * plus data added by MetaMask. - * @property metamaskId - Added for tracking and identification within MetaMask - * @property from - Address from which the message is processed - * @property origin? - Added for request origin identification + * + * metamaskId - Added for tracking and identification within MetaMask + * + * from - Address from which the message is processed + * + * origin? - Added for request origin identification */ export type AbstractMessageParamsMetamask = AbstractMessageParams & { metamaskId?: string; }; /** - * @type MessageManagerState + * MessageManagerState * * Message Manager state - * @property unapprovedMessages - A collection of all Messages in the 'unapproved' state - * @property unapprovedMessagesCount - The count of all Messages in this.unapprovedMessages + * + * unapprovedMessages - A collection of all Messages in the 'unapproved' state + * + * unapprovedMessagesCount - The count of all Messages in this.unapprovedMessages */ export type MessageManagerState = { unapprovedMessages: Record; @@ -128,11 +143,15 @@ export type SecurityProviderRequest = ( /** * AbstractMessageManager constructor options. * - * @property additionalFinishStatuses - Optional list of statuses that are accepted to emit a finished event. - * @property messenger - Controller messaging system. - * @property name - The name of the manager. - * @property securityProviderRequest - A function for verifying a message, whether it is malicious or not. - * @property state - Initial state to set on this controller. + * additionalFinishStatuses - Optional list of statuses that are accepted to emit a finished event. + * + * messenger - Controller messaging system. + * + * name - The name of the manager. + * + * securityProviderRequest - A function for verifying a message, whether it is malicious or not. + * + * state - Initial state to set on this controller. */ export type AbstractMessageManagerOptions< Name extends string, @@ -205,6 +224,7 @@ export abstract class AbstractMessageManager< /** * Adds request props to the message params and returns a new messageParams object. + * * @param messageParams - The messageParams to add the request props to. * @param req - The original request object. * @returns The messageParams with the request props added. @@ -226,6 +246,7 @@ export abstract class AbstractMessageManager< /** * Creates a new Message with a random id and an 'unapproved' status. + * * @param messageParams - The messageParams to add the request props to. * @param type - The approval type of the message. * @param req - The original request object. diff --git a/packages/message-manager/src/DecryptMessageManager.ts b/packages/message-manager/src/DecryptMessageManager.ts index 0ae8d1d80bd..c3b239b95e2 100644 --- a/packages/message-manager/src/DecryptMessageManager.ts +++ b/packages/message-manager/src/DecryptMessageManager.ts @@ -55,13 +55,16 @@ type DecryptMessageManagerOptions = { }; /** - * @type DecryptMessage + * DecryptMessage * * Represents and contains data about a 'eth_decrypt' type signature request. * These are created when a signature for an eth_decrypt call is requested. - * @property id - An id to track and identify the message object - * @property messageParams - The parameters to pass to the eth_decrypt method once the request is approved - * @property type - The json-prc signing method for which a signature request has been made. + * + * id - An id to track and identify the message object + * + * messageParams - The parameters to pass to the eth_decrypt method once the request is approved + * + * type - The json-prc signing method for which a signature request has been made. * A 'DecryptMessage' which always has a 'eth_decrypt' type */ export type DecryptMessage = AbstractMessage & { @@ -69,24 +72,29 @@ export type DecryptMessage = AbstractMessage & { }; /** - * @type DecryptMessageParams + * DecryptMessageParams * * Represents the parameters to pass to the eth_decrypt method once the request is approved. - * @property data - A hex string conversion of the raw buffer data of the signature request + * + * data - A hex string conversion of the raw buffer data of the signature request */ export type DecryptMessageParams = AbstractMessageParams & { data: string; }; /** - * @type DecryptMessageParamsMetamask + * DecryptMessageParamsMetamask * * Represents the parameters to pass to the eth_decrypt method once the request is approved * plus data added by MetaMask. - * @property metamaskId - Added for tracking and identification within MetaMask - * @property data - A hex string conversion of the raw buffer data of the signature request - * @property from - Address to sign this message from - * @property origin? - Added for request origin identification + * + * metamaskId - Added for tracking and identification within MetaMask + * + * data - A hex string conversion of the raw buffer data of the signature request + * + * from - Address to sign this message from + * + * origin? - Added for request origin identification */ // This interface was created before this ESLint rule was added. // Convert to a `type` in a future major version. diff --git a/packages/message-manager/src/EncryptionPublicKeyManager.ts b/packages/message-manager/src/EncryptionPublicKeyManager.ts index eff493ee3fb..d70d8d5696b 100644 --- a/packages/message-manager/src/EncryptionPublicKeyManager.ts +++ b/packages/message-manager/src/EncryptionPublicKeyManager.ts @@ -58,38 +58,48 @@ type EncryptionPublicKeyManagerOptions = { }; /** - * @type EncryptionPublicKey + * EncryptionPublicKey * * Represents and contains data about a 'eth_getEncryptionPublicKey' type request. * These are created when an encryption public key is requested. - * @property id - An id to track and identify the message object - * @property messageParams - The parameters to pass to the eth_getEncryptionPublicKey method once the request is approved - * @property type - The json-prc method for which an encryption public key request has been made. + * + * id - An id to track and identify the message object + * + * messageParams - The parameters to pass to the eth_getEncryptionPublicKey method once the request is approved + * + * type - The json-prc method for which an encryption public key request has been made. * A 'Message' which always has a 'eth_getEncryptionPublicKey' type - * @property rawSig - Encryption public key + * + * rawSig - Encryption public key */ export type EncryptionPublicKey = AbstractMessage & { messageParams: EncryptionPublicKeyParams; }; /** - * @type EncryptionPublicKeyParams + * EncryptionPublicKeyParams * * Represents the parameters to pass to the method once the request is approved. - * @property from - Address from which to extract the encryption public key - * @property origin? - Added for request origin identification + * + * from - Address from which to extract the encryption public key + * + * origin? - Added for request origin identification */ export type EncryptionPublicKeyParams = AbstractMessageParams; /** - * @type MessageParamsMetamask + * MessageParamsMetamask * * Represents the parameters to pass to the eth_getEncryptionPublicKey method once the request is approved * plus data added by MetaMask. - * @property metamaskId - Added for tracking and identification within MetaMask - * @property data - Encryption public key - * @property from - Address from which to extract the encryption public key - * @property origin? - Added for request origin identification + * + * metamaskId - Added for tracking and identification within MetaMask + * + * data - Encryption public key + * + * from - Address from which to extract the encryption public key + * + * origin? - Added for request origin identification */ export type EncryptionPublicKeyParamsMetamask = AbstractMessageParamsMetamask & { diff --git a/packages/message-manager/src/index.ts b/packages/message-manager/src/index.ts index 27723685451..bdcd9e46a88 100644 --- a/packages/message-manager/src/index.ts +++ b/packages/message-manager/src/index.ts @@ -1,4 +1,4 @@ export * from './AbstractMessageManager'; export * from './EncryptionPublicKeyManager'; export * from './DecryptMessageManager'; -export * from './types'; +export type * from './types'; diff --git a/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts b/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts index 832b61bf082..6cc27c9e1e3 100644 --- a/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts +++ b/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts @@ -35,7 +35,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { mockNext, (error) => { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); }, ); @@ -46,7 +46,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -93,7 +93,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(e); } }, @@ -105,7 +105,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -152,7 +152,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(e); } }, @@ -164,7 +164,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -216,7 +216,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(e); } }, @@ -228,7 +228,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -263,7 +263,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { mockNext, (error) => { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); }, ); @@ -274,7 +274,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -325,7 +325,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(e); } }, @@ -337,7 +337,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -361,7 +361,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { mockNext, (error) => { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); }, ); @@ -372,7 +372,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -397,7 +397,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { mockNext, (error) => { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); }, ); @@ -408,7 +408,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -440,7 +440,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(e); } }, @@ -452,7 +452,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); @@ -494,7 +494,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(e); } }, @@ -506,7 +506,7 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors + reject(error); } }); diff --git a/packages/name-controller/src/NameController.ts b/packages/name-controller/src/NameController.ts index 1c1385bb4b8..a1c8effd3eb 100644 --- a/packages/name-controller/src/NameController.ts +++ b/packages/name-controller/src/NameController.ts @@ -23,11 +23,11 @@ export const PROPOSED_NAME_EXPIRE_DURATION = 60 * 60 * 24; // 24 hours export enum NameOrigin { // Originated from an account identity. // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + ACCOUNT_IDENTITY = 'account-identity', // Originated from an address book entry. // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + ADDRESS_BOOK = 'address-book', // Originated from the API (NameController.setName). This is the default. API = 'api', @@ -141,9 +141,9 @@ export class NameController extends BaseController< NameControllerState, NameControllerMessenger > { - #providers: NameProvider[]; + readonly #providers: NameProvider[]; - #updateDelay: number; + readonly #updateDelay: number; /** * Construct a Name controller. diff --git a/packages/name-controller/src/providers/ens.test.ts b/packages/name-controller/src/providers/ens.test.ts index 126fb0cdcd7..2bc6b042bdb 100644 --- a/packages/name-controller/src/providers/ens.test.ts +++ b/packages/name-controller/src/providers/ens.test.ts @@ -1,5 +1,5 @@ -import { NameType } from '../types'; import { ENSNameProvider } from './ens'; +import { NameType } from '../types'; jest.mock('../util'); diff --git a/packages/name-controller/src/providers/ens.ts b/packages/name-controller/src/providers/ens.ts index 20dfa8eadc6..84f7df329df 100644 --- a/packages/name-controller/src/providers/ens.ts +++ b/packages/name-controller/src/providers/ens.ts @@ -18,9 +18,9 @@ const LABEL = 'Ethereum Name Service (ENS)'; const log = createModuleLogger(projectLogger, 'ens'); export class ENSNameProvider implements NameProvider { - #isEnabled: () => boolean; + readonly #isEnabled: () => boolean; - #reverseLookup: ReverseLookupCallback; + readonly #reverseLookup: ReverseLookupCallback; constructor({ isEnabled, diff --git a/packages/name-controller/src/providers/etherscan.test.ts b/packages/name-controller/src/providers/etherscan.test.ts index 78ae2d42e41..da6cbca600f 100644 --- a/packages/name-controller/src/providers/etherscan.test.ts +++ b/packages/name-controller/src/providers/etherscan.test.ts @@ -1,7 +1,7 @@ +import { EtherscanNameProvider } from './etherscan'; import { CHAIN_IDS } from '../constants'; import { NameType } from '../types'; import { handleFetch } from '../util'; -import { EtherscanNameProvider } from './etherscan'; jest.mock('../util'); diff --git a/packages/name-controller/src/providers/etherscan.ts b/packages/name-controller/src/providers/etherscan.ts index 377bcb01719..503b01ecc67 100644 --- a/packages/name-controller/src/providers/etherscan.ts +++ b/packages/name-controller/src/providers/etherscan.ts @@ -24,51 +24,51 @@ type EtherscanGetSourceCodeResponse = { result: [ { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + SourceCode: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + ABI: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + ContractName: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + CompilerVersion: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + OptimizationUsed: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + Runs: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + ConstructorArguments: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + Library: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + LicenseType: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + Proxy: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + Implementation: string; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + SwarmSource: string; }, ]; }; export class EtherscanNameProvider implements NameProvider { - #isEnabled: () => boolean; + readonly #isEnabled: () => boolean; #lastRequestTime = 0; - #mutex = new Mutex(); + readonly #mutex = new Mutex(); constructor({ isEnabled }: { isEnabled?: () => boolean } = {}) { this.#isEnabled = isEnabled || (() => true); @@ -193,7 +193,7 @@ export class EtherscanNameProvider implements NameProvider { Object.keys(params).forEach((key, index) => { const value = params[key]; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + url += `${index === 0 ? '?' : '&'}${key}=${value}`; }); diff --git a/packages/name-controller/src/providers/lens.test.ts b/packages/name-controller/src/providers/lens.test.ts index dc22770dbf3..4af8e5829fe 100644 --- a/packages/name-controller/src/providers/lens.test.ts +++ b/packages/name-controller/src/providers/lens.test.ts @@ -1,6 +1,6 @@ +import { LensNameProvider } from './lens'; import { NameType } from '../types'; import { graphQL } from '../util'; -import { LensNameProvider } from './lens'; jest.mock('../util'); diff --git a/packages/name-controller/src/providers/lens.ts b/packages/name-controller/src/providers/lens.ts index 36e05744806..b3560c1e7f5 100644 --- a/packages/name-controller/src/providers/lens.ts +++ b/packages/name-controller/src/providers/lens.ts @@ -34,7 +34,7 @@ type LensResponse = { }; export class LensNameProvider implements NameProvider { - #isEnabled: () => boolean; + readonly #isEnabled: () => boolean; constructor({ isEnabled }: { isEnabled?: () => boolean } = {}) { this.#isEnabled = isEnabled || (() => true); diff --git a/packages/name-controller/src/providers/token.test.ts b/packages/name-controller/src/providers/token.test.ts index 4215e2dfe51..3094459fdab 100644 --- a/packages/name-controller/src/providers/token.test.ts +++ b/packages/name-controller/src/providers/token.test.ts @@ -1,6 +1,6 @@ +import { TokenNameProvider } from './token'; import { NameType } from '../types'; import { handleFetch } from '../util'; -import { TokenNameProvider } from './token'; jest.mock('../util'); diff --git a/packages/name-controller/src/providers/token.ts b/packages/name-controller/src/providers/token.ts index c9a47b355b7..b082439caba 100644 --- a/packages/name-controller/src/providers/token.ts +++ b/packages/name-controller/src/providers/token.ts @@ -14,7 +14,7 @@ const LABEL = 'Blockchain (Token Name)'; const log = createModuleLogger(projectLogger, 'token'); export class TokenNameProvider implements NameProvider { - #isEnabled: () => boolean; + readonly #isEnabled: () => boolean; constructor({ isEnabled }: { isEnabled?: () => boolean } = {}) { this.#isEnabled = isEnabled || (() => true); diff --git a/packages/name-controller/src/types.ts b/packages/name-controller/src/types.ts index 1bcb952b82d..6bdb5a84494 100644 --- a/packages/name-controller/src/types.ts +++ b/packages/name-controller/src/types.ts @@ -2,7 +2,7 @@ export enum NameType { /** The address of an Ethereum account. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + ETHEREUM_ADDRESS = 'ethereumAddress', } diff --git a/packages/name-controller/src/util.ts b/packages/name-controller/src/util.ts index a4ce342c056..eb4c9265f84 100644 --- a/packages/name-controller/src/util.ts +++ b/packages/name-controller/src/util.ts @@ -6,7 +6,7 @@ * @param variables - GraphQL variables. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export async function graphQL( url: string, query: string, diff --git a/packages/network-controller/src/NetworkController.ts b/packages/network-controller/src/NetworkController.ts index e8204301abc..979758a099b 100644 --- a/packages/network-controller/src/NetworkController.ts +++ b/packages/network-controller/src/NetworkController.ts @@ -706,7 +706,7 @@ function getDefaultInfuraNetworkConfigurationsByChainId(): Record< const rpcEndpointUrl = // False positive - this is a string. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `https://${infuraNetworkType}.infura.io/v3/{infuraProjectId}` as const; const networkConfiguration: NetworkConfiguration = { diff --git a/packages/network-controller/tests/network-client/helpers.ts b/packages/network-controller/tests/network-client/helpers.ts index bc6fface4ba..3ec20ed768b 100644 --- a/packages/network-controller/tests/network-client/helpers.ts +++ b/packages/network-controller/tests/network-client/helpers.ts @@ -431,7 +431,7 @@ export async function waitForPromiseToBeFulfilledAfterRunningAllTimers( let numTimesClockHasBeenAdvanced = 0; // This is a mistake, we are catching this promise. - // eslint-disable-next-line promise/catch-or-return + promise // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/permission-controller/src/PermissionController.test.ts b/packages/permission-controller/src/PermissionController.test.ts index 6bbdf7c417c..57513804017 100644 --- a/packages/permission-controller/src/PermissionController.test.ts +++ b/packages/permission-controller/src/PermissionController.test.ts @@ -6208,7 +6208,7 @@ describe('PermissionController', () => { }); // ESLint is confused; this signature is async. - // eslint-disable-next-line @typescript-eslint/await-thenable + const response = await engine.handle(request); assertIsJsonRpcFailure(response); expect(response.error).toMatchObject( @@ -6232,7 +6232,7 @@ describe('PermissionController', () => { const expectedError = errors.methodNotFound('wallet_foo', { origin }); // ESLint is confused; this signature is async. - // eslint-disable-next-line @typescript-eslint/await-thenable + const response = await engine.handle(request); assertIsJsonRpcFailure(response); const { error } = response; @@ -6283,7 +6283,7 @@ describe('PermissionController', () => { ); // ESLint is confused; this signature is async. - // eslint-disable-next-line @typescript-eslint/await-thenable + const response = await engine.handle(request); assertIsJsonRpcFailure(response); const { error } = response; diff --git a/packages/permission-controller/src/SubjectMetadataController.ts b/packages/permission-controller/src/SubjectMetadataController.ts index f959674cad9..7af3c599908 100644 --- a/packages/permission-controller/src/SubjectMetadataController.ts +++ b/packages/permission-controller/src/SubjectMetadataController.ts @@ -146,14 +146,14 @@ export class SubjectMetadataController extends BaseController< this.messenger.registerActionHandler( // ESLint is confused by the string literal type. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `${this.name}:getSubjectMetadata`, this.getSubjectMetadata.bind(this), ); this.messenger.registerActionHandler( // ESLint is confused by the string literal type. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `${this.name}:addSubjectMetadata`, this.addSubjectMetadata.bind(this), ); diff --git a/packages/permission-controller/src/rpc-methods/getPermissions.test.ts b/packages/permission-controller/src/rpc-methods/getPermissions.test.ts index f7724f4617b..c55edc7924d 100644 --- a/packages/permission-controller/src/rpc-methods/getPermissions.test.ts +++ b/packages/permission-controller/src/rpc-methods/getPermissions.test.ts @@ -2,8 +2,8 @@ import { JsonRpcEngine } from '@metamask/json-rpc-engine'; import type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils'; import { assertIsJsonRpcSuccess } from '@metamask/utils'; -import type { PermissionConstraint } from '../Permission'; import { getPermissionsHandler } from './getPermissions'; +import type { PermissionConstraint } from '../Permission'; describe('getPermissions RPC method', () => { it('returns the values of the object returned by getPermissionsForOrigin', async () => { diff --git a/packages/permission-controller/src/rpc-methods/requestPermissions.ts b/packages/permission-controller/src/rpc-methods/requestPermissions.ts index a74ba986966..ae77a2dfae5 100644 --- a/packages/permission-controller/src/rpc-methods/requestPermissions.ts +++ b/packages/permission-controller/src/rpc-methods/requestPermissions.ts @@ -54,9 +54,8 @@ async function requestPermissionsImplementation( } const [requestedPermissions] = params; - const [grantedPermissions] = await requestPermissionsForOrigin( - requestedPermissions, - ); + const [grantedPermissions] = + await requestPermissionsForOrigin(requestedPermissions); // `wallet_requestPermission` is specified to return an array. res.result = Object.values(grantedPermissions); diff --git a/packages/permission-controller/src/rpc-methods/revokePermissions.test.ts b/packages/permission-controller/src/rpc-methods/revokePermissions.test.ts index 5d9a9fdc216..8dc1ea102a9 100644 --- a/packages/permission-controller/src/rpc-methods/revokePermissions.test.ts +++ b/packages/permission-controller/src/rpc-methods/revokePermissions.test.ts @@ -84,7 +84,7 @@ describe('revokePermissions RPC method', () => { delete expectedError.stack; // ESLint is confused; this signature is async. - // eslint-disable-next-line @typescript-eslint/await-thenable + const response = await engine.handle(req); assertIsJsonRpcFailure(response); delete response.error.stack; @@ -121,7 +121,7 @@ describe('revokePermissions RPC method', () => { delete expectedError.stack; // ESLint is confused; this signature is async. - // eslint-disable-next-line @typescript-eslint/await-thenable + const response = await engine.handle(req); assertIsJsonRpcFailure(response); delete response.error.stack; @@ -157,7 +157,7 @@ describe('revokePermissions RPC method', () => { delete expectedError.stack; // ESLint is confused; this signature is async. - // eslint-disable-next-line @typescript-eslint/await-thenable + const response = await engine.handle(req); assertIsJsonRpcFailure(response); delete response.error.stack; @@ -194,7 +194,7 @@ describe('revokePermissions RPC method', () => { delete expectedError.stack; // ESLint is confused; this signature is async. - // eslint-disable-next-line @typescript-eslint/await-thenable + const response = await engine.handle(req); assertIsJsonRpcFailure(response); delete response.error.stack; diff --git a/packages/permission-log-controller/src/PermissionLogController.ts b/packages/permission-log-controller/src/PermissionLogController.ts index fb52ae08d14..0cb119339ed 100644 --- a/packages/permission-log-controller/src/PermissionLogController.ts +++ b/packages/permission-log-controller/src/PermissionLogController.ts @@ -57,9 +57,11 @@ export type PermissionHistory = Record; /** * - * Permission log controller state - * @property permissionHistory - permission history - * @property permissionActivityLog - permission activity logs + *Permission log controller state + * + *permissionHistory - permission history + * + * permissionActivityLog - permission activity logs */ export type PermissionLogControllerState = { permissionHistory: PermissionHistory; @@ -108,7 +110,7 @@ export class PermissionLogController extends BaseController< PermissionLogControllerState, PermissionLogControllerMessenger > { - #restrictedMethods: Set; + readonly #restrictedMethods: Set; constructor({ messenger, @@ -152,7 +154,7 @@ export class PermissionLogController extends BaseController< } const newEntries = { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + eth_accounts: { accounts: this.#getAccountToTimeMap(accounts, Date.now()), }, @@ -320,7 +322,7 @@ export class PermissionLogController extends BaseController< const accounts = result as string[]; newEntries = { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + eth_accounts: { accounts: this.#getAccountToTimeMap(accounts, time), lastApproved: time, diff --git a/packages/permission-log-controller/src/enums.ts b/packages/permission-log-controller/src/enums.ts index fde713341dc..36d323b95a1 100644 --- a/packages/permission-log-controller/src/enums.ts +++ b/packages/permission-log-controller/src/enums.ts @@ -10,13 +10,13 @@ export const LOG_IGNORE_METHODS = [ ]; // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export enum LOG_METHOD_TYPES { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + restricted = 'restricted', // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + internal = 'internal', } diff --git a/packages/permission-log-controller/tests/helpers.ts b/packages/permission-log-controller/tests/helpers.ts index 88a66b3aa92..4857f4ed2a3 100644 --- a/packages/permission-log-controller/tests/helpers.ts +++ b/packages/permission-log-controller/tests/helpers.ts @@ -24,13 +24,13 @@ const SUBJECTS = { const PERM_NAMES = Object.freeze({ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + eth_accounts: 'eth_accounts', // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + test_method: 'test_method', // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + does_not_exist: 'does_not_exist', }); @@ -60,7 +60,7 @@ const CAVEATS = { * @returns An eth_accounts restrictReturnedAccounts caveats */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + eth_accounts: (accounts: string[]) => { return [ { @@ -86,10 +86,10 @@ const PERMS = { * @returns A permissions request object with eth_accounts */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + eth_accounts: () => { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + return { eth_accounts: {} }; }, @@ -99,10 +99,10 @@ const PERMS = { * @returns A permissions request object with test_method */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + test_method: () => { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + return { test_method: {} }; }, @@ -112,10 +112,10 @@ const PERMS = { * @returns A permissions request object with does_not_exist */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + does_not_exist: () => { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + return { does_not_exist: {} }; }, }, @@ -133,7 +133,7 @@ const PERMS = { * @returns A granted permissions object with eth_accounts and its caveat */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + eth_accounts: (accounts: string[]) => { return { parentCapability: PERM_NAMES.eth_accounts, @@ -147,7 +147,7 @@ const PERMS = { * @returns A granted permissions object with test_method */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + test_method: () => { return { parentCapability: PERM_NAMES.test_method, @@ -194,7 +194,7 @@ export const getters = deepFreeze({ * @returns An RPC request object */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + eth_accounts: (origin: string) => { return { ...JsonRpcRequestStruct.TYPE, @@ -212,7 +212,7 @@ export const getters = deepFreeze({ * @returns An RPC request object */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + test_method: (origin: string, param = false) => { return { ...JsonRpcRequestStruct.TYPE, @@ -229,7 +229,7 @@ export const getters = deepFreeze({ * @returns An RPC request object */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + eth_requestAccounts: (origin: string) => { return { ...JsonRpcRequestStruct.TYPE, @@ -285,7 +285,7 @@ export const getters = deepFreeze({ * @returns An RPC request object */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + metamask_sendDomainMetadata: ( origin: string, name: string, diff --git a/packages/phishing-controller/src/PhishingController.ts b/packages/phishing-controller/src/PhishingController.ts index ddad8ece2d3..3f8a9178951 100644 --- a/packages/phishing-controller/src/PhishingController.ts +++ b/packages/phishing-controller/src/PhishingController.ts @@ -79,7 +79,7 @@ export const METAMASK_HOTLIST_DIFF_URL = `${PHISHING_CONFIG_BASE_URL}${METAMASK_ export const C2_DOMAIN_BLOCKLIST_URL = `${CLIENT_SIDE_DETECION_BASE_URL}${C2_DOMAIN_BLOCKLIST_ENDPOINT}`; /** - * @type ListTypes + * ListTypes * * Type outlining the types of lists provided by aggregating different source lists */ @@ -91,14 +91,19 @@ export type ListTypes = | 'c2DomainBlocklist'; /** - * @type EthPhishingResponse + * EthPhishingResponse * * Configuration response from the eth-phishing-detect package * consisting of approved and unapproved website origins - * @property blacklist - List of unapproved origins - * @property fuzzylist - List of fuzzy-matched unapproved origins - * @property tolerance - Fuzzy match tolerance level - * @property version - Version number of this configuration + * + * blacklist - List of unapproved origins + * + * fuzzylist - List of fuzzy-matched unapproved origins + * + * tolerance - Fuzzy match tolerance level + * + * version - Version number of this configuration + * * @property whitelist - List of approved origins */ export type EthPhishingResponse = { @@ -110,12 +115,15 @@ export type EthPhishingResponse = { }; /** - * @type C2DomainBlocklistResponse + * C2DomainBlocklistResponse * * Response for blocklist update requests - * @property recentlyAdded - List of c2 domains recently added to the blocklist - * @property recentlyRemoved - List of c2 domains recently removed from the blocklist - * @property lastFetchedAt - Timestamp of the last fetch request + * + * recentlyAdded - List of c2 domains recently added to the blocklist + * + * recentlyRemoved - List of c2 domains recently removed from the blocklist + * + * lastFetchedAt - Timestamp of the last fetch request */ export type C2DomainBlocklistResponse = { recentlyAdded: string[]; @@ -145,13 +153,18 @@ export type PhishingStalelist = { }; /** - * @type PhishingListState + * PhishingListState * * type defining the persisted list state. This is the persisted state that is updated frequently with `this.maybeUpdateState()`. - * @property allowlist - List of approved origins (legacy naming "whitelist") - * @property blocklist - List of unapproved origins (legacy naming "blacklist") - * @property blocklistPaths - Trie of unapproved origins with paths (hostname + path, no query params). - * @property c2DomainBlocklist - List of hashed hostnames that C2 requests are blocked against. + * + * allowlist - List of approved origins (legacy naming "whitelist") + * + * blocklist - List of unapproved origins (legacy naming "blacklist") + * + * blocklistPaths - Trie of unapproved origins with paths (hostname + path, no query params). + * + * c2DomainBlocklist - List of hashed hostnames that C2 requests are blocked against. + * * @property fuzzylist - List of fuzzy-matched unapproved origins * @property tolerance - Fuzzy match tolerance level * @property lastUpdated - Timestamp of last update. @@ -171,13 +184,17 @@ export type PhishingListState = { }; /** - * @type HotlistDiff + * HotlistDiff * * type defining the expected type of the diffs in hotlist.json file. - * @property url - Url of the diff entry. - * @property timestamp - Timestamp at which the diff was identified. - * @property targetList - The list name where the diff was identified. - * @property isRemoval - Was the diff identified a removal type. + * + * url - Url of the diff entry. + * + * timestamp - Timestamp at which the diff was identified. + * + * targetList - The list name where the diff was identified. + * + * isRemoval - Was the diff identified a removal type. */ export type HotlistDiff = { url: string; @@ -191,13 +208,17 @@ export type DataResultWrapper = { }; /** - * @type Hotlist + * Hotlist * * Type defining expected hotlist.json file. - * @property url - Url of the diff entry. - * @property timestamp - Timestamp at which the diff was identified. - * @property targetList - The list name where the diff was identified. - * @property isRemoval - Was the diff identified a removal type. + * + * url - Url of the diff entry. + * + * timestamp - Timestamp at which the diff was identified. + * + * targetList - The list name where the diff was identified. + * + * isRemoval - Was the diff identified a removal type. */ export type Hotlist = HotlistDiff[]; @@ -304,7 +325,7 @@ const getDefaultState = (): PhishingControllerState => { }; /** - * @type PhishingControllerState + * PhishingControllerState * * Phishing controller state * phishingLists - array of phishing lists diff --git a/packages/polling-controller/src/AbstractPollingController.ts b/packages/polling-controller/src/AbstractPollingController.ts index f22455e4b13..f5b37946ef3 100644 --- a/packages/polling-controller/src/AbstractPollingController.ts +++ b/packages/polling-controller/src/AbstractPollingController.ts @@ -18,7 +18,7 @@ export const getKey = (input: PollingInput): PollingTokenSetId => * @returns The composed class. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + export function AbstractPollingControllerBaseMixin< TBase extends Constructor, PollingInput extends Json, @@ -29,8 +29,10 @@ export function AbstractPollingControllerBaseMixin< { readonly #pollingTokenSets: Map> = new Map(); - #callbacks: Map void>> = - new Map(); + readonly #callbacks: Map< + PollingTokenSetId, + Set<(input: PollingInput) => void> + > = new Map(); abstract _executePoll(input: PollingInput): Promise; diff --git a/packages/polling-controller/src/BlockTrackerPollingController.ts b/packages/polling-controller/src/BlockTrackerPollingController.ts index f7221768f90..86594523a48 100644 --- a/packages/polling-controller/src/BlockTrackerPollingController.ts +++ b/packages/polling-controller/src/BlockTrackerPollingController.ts @@ -27,7 +27,7 @@ export type BlockTrackerPollingInput = { * @returns The composed class. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + function BlockTrackerPollingControllerMixin< TBase extends Constructor, PollingInput extends BlockTrackerPollingInput, @@ -59,7 +59,7 @@ function BlockTrackerPollingControllerMixin< } else { throw new Error( // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `Unable to retrieve blockTracker for networkClientId ${input.networkClientId}`, ); } diff --git a/packages/polling-controller/src/StaticIntervalPollingController.ts b/packages/polling-controller/src/StaticIntervalPollingController.ts index 5076dfcffdf..22b682f2f0d 100644 --- a/packages/polling-controller/src/StaticIntervalPollingController.ts +++ b/packages/polling-controller/src/StaticIntervalPollingController.ts @@ -19,7 +19,7 @@ import type { * @returns The composed class. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + function StaticIntervalPollingControllerMixin< TBase extends Constructor, PollingInput extends Json, diff --git a/packages/rate-limit-controller/src/RateLimitController.ts b/packages/rate-limit-controller/src/RateLimitController.ts index 3afe1fe5ef2..d927c2c12be 100644 --- a/packages/rate-limit-controller/src/RateLimitController.ts +++ b/packages/rate-limit-controller/src/RateLimitController.ts @@ -10,9 +10,11 @@ import { getKnownPropertyNames } from '@metamask/utils'; /** * A rate-limited API endpoint. * - * @property method - The method that is rate-limited. - * @property rateLimitTimeout - The time window in which the rate limit is applied (in ms). - * @property rateLimitCount - The amount of calls an origin can make in the rate limit time window. + * method - The method that is rate-limited. + * + * rateLimitTimeout - The time window in which the rate limit is applied (in ms). + * + * rateLimitCount - The amount of calls an origin can make in the rate limit time window. */ export type RateLimitedApi = { method: ActionConstraint['handler']; @@ -37,7 +39,7 @@ export type RateLimitedRequests = * The state of the {@link RateLimitController}. * * @template RateLimitedApis - A {@link RateLimitedApiMap} containing the rate-limited API endpoints that is used by the {@link RateLimitController}. - * @property requests - An object containing the number of requests made in a given interval for each origin and api type combination. + * requests - An object containing the number of requests made in a given interval for each origin and api type combination. */ export type RateLimitState = { requests: RateLimitedRequests; @@ -218,7 +220,7 @@ export class RateLimitController< requests: { ...(state.requests as RateLimitedRequests), // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + [api]: { [origin]: previous + 1 }, }, }); diff --git a/packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.test.ts b/packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.test.ts index 0cd8756d47c..ad6f5088f7f 100644 --- a/packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.test.ts +++ b/packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.test.ts @@ -1,3 +1,4 @@ +import { ClientConfigApiService } from './client-config-api-service'; import { BASE_URL } from '../constants'; import type { ApiDataResponse, @@ -8,7 +9,6 @@ import { DistributionType, EnvironmentType, } from '../remote-feature-flag-controller-types'; -import { ClientConfigApiService } from './client-config-api-service'; const mockServerFeatureFlagsResponse: ApiDataResponse = [ { feature1: false }, @@ -249,6 +249,7 @@ describe('ClientConfigApiService', () => { /** * Creates a mock fetch function with configurable response data and options + * * @template T - The type of data to be returned by the fetch response * @param params - Configuration parameters * @param params.response - Optional Response properties to override defaults diff --git a/packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.ts b/packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.ts index 73e642526d8..e91ffb0b3b4 100644 --- a/packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.ts +++ b/packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.ts @@ -21,15 +21,15 @@ import type { * This service is responsible for fetching feature flags from the ClientConfig API. */ export class ClientConfigApiService implements AbstractClientConfigApiService { - #fetch: typeof fetch; + readonly #fetch: typeof fetch; readonly #policy: ServicePolicy; - #client: ClientType; + readonly #client: ClientType; - #distribution: DistributionType; + readonly #distribution: DistributionType; - #environment: EnvironmentType; + readonly #environment: EnvironmentType; /** * Constructs a new ClientConfigApiService object. @@ -172,6 +172,7 @@ export class ClientConfigApiService implements AbstractClientConfigApiService { /** * Fetches feature flags from the API with specific client, distribution, and environment parameters. * Provides structured error handling, including fallback to cached data if available. + * * @returns An object of feature flags and their boolean values or a structured error object. */ public async fetchRemoteFeatureFlags(): Promise { @@ -203,6 +204,7 @@ export class ClientConfigApiService implements AbstractClientConfigApiService { /** * Flattens an array of feature flag objects into a single feature flags object. + * * @param responseData - Array of objects containing feature flag key-value pairs * @returns A single object containing all feature flags merged together * @example diff --git a/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts b/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts index a20131996e5..0ff29495912 100644 --- a/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts +++ b/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts @@ -109,7 +109,7 @@ export class RemoteFeatureFlagController extends BaseController< #inProgressFlagUpdate?: Promise; - #getMetaMetricsId: () => string; + readonly #getMetaMetricsId: () => string; /** * Constructs a new RemoteFeatureFlagController instance. @@ -157,7 +157,6 @@ export class RemoteFeatureFlagController extends BaseController< * Checks if the cached feature flags are expired based on the fetch interval. * * @returns Whether the cache is expired (`true`) or still valid (`false`). - * @private */ #isCacheExpired(): boolean { return Date.now() - this.state.cacheTimestamp > this.#fetchInterval; @@ -197,7 +196,6 @@ export class RemoteFeatureFlagController extends BaseController< * Updates the controller's state with new feature flags and resets the cache timestamp. * * @param remoteFeatureFlags - The new feature flags to cache. - * @private */ async #updateCache(remoteFeatureFlags: FeatureFlags) { const processedRemoteFeatureFlags = diff --git a/packages/remote-feature-flag-controller/src/utils/user-segmentation-utils.ts b/packages/remote-feature-flag-controller/src/utils/user-segmentation-utils.ts index b14056c453c..07519d03ce3 100644 --- a/packages/remote-feature-flag-controller/src/utils/user-segmentation-utils.ts +++ b/packages/remote-feature-flag-controller/src/utils/user-segmentation-utils.ts @@ -5,6 +5,7 @@ import type { FeatureFlagScopeValue } from '../remote-feature-flag-controller-ty /** * Converts a UUID string to a BigInt by removing dashes and converting to hexadecimal. + * * @param uuid - The UUID string to convert * @returns The UUID as a BigInt value */ @@ -22,6 +23,7 @@ const UUID_V4_VALUE_RANGE_BIGINT = MAX_UUID_V4_BIGINT - MIN_UUID_V4_BIGINT; * Generates a deterministic random number between 0 and 1 based on a metaMetricsId. * This is useful for A/B testing and feature flag rollouts where we want * consistent group assignment for the same user. + * * @param metaMetricsId - The unique identifier used to generate the deterministic random number. Must be either: * - A UUIDv4 string (e.g., '123e4567-e89b-12d3-a456-426614174000' * - A hex string with '0x' prefix (e.g., '0x86bacb9b2bf9a7e8d2b147eadb95ac9aaa26842327cd24afc8bd4b3c1d136420') diff --git a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts index 2c82b73f7c6..90d5b8ddf79 100644 --- a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts +++ b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts @@ -298,7 +298,7 @@ type RootMessenger = Messenger< MockAnyNamespace, MessengerActions, // TODO: Disable this lint rule - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments + MessengerEvents >; diff --git a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts index f8747e54dad..8caa5f8e588 100644 --- a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts +++ b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts @@ -53,7 +53,7 @@ export type SampleGasPricesServiceMessenger = Messenger< typeof serviceName, SampleGasPricesServiceActions | AllowedActions, // TODO: Disable this lint rule - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments + SampleGasPricesServiceEvents | AllowedEvents >; diff --git a/packages/shield-controller/src/polling-with-policy.test.ts b/packages/shield-controller/src/polling-with-policy.test.ts index 5187d2f68dd..bfe60b59c40 100644 --- a/packages/shield-controller/src/polling-with-policy.test.ts +++ b/packages/shield-controller/src/polling-with-policy.test.ts @@ -23,7 +23,6 @@ describe('PollingWithCockatielPolicy', () => { setTimeout(() => { // eslint-disable-next-line jest/no-conditional-in-test if (invocationCount < 3) { - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- HttpError is a valid error which extends Error class reject(new HttpError(412, 'Results are not available yet')); } resolve('test'); @@ -41,7 +40,6 @@ describe('PollingWithCockatielPolicy', () => { .fn() .mockImplementation(async (_abortSignal: AbortSignal) => { return new Promise((_resolve, reject) => { - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- HttpError is a valid error which extends Error class reject(new HttpError(500, 'Internal server error')); }); }); @@ -61,7 +59,6 @@ describe('PollingWithCockatielPolicy', () => { .mockImplementation(async (_abortSignal: AbortSignal) => { return new Promise((_resolve, reject) => { setTimeout(() => { - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- HttpError is a valid error which extends Error class reject(new HttpError(412, 'Results are not available yet')); }, 100); }); @@ -86,7 +83,7 @@ describe('PollingWithCockatielPolicy', () => { if (abortSignal.aborted) { reject(new Error('test error')); } - // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- HttpError is a valid error which extends Error class + reject(new HttpError(412, 'Results are not available yet')); }, 100); }); diff --git a/packages/transaction-controller/src/helpers/ResimulateHelper.ts b/packages/transaction-controller/src/helpers/ResimulateHelper.ts index 6bb1a51c23c..7a3403fc800 100644 --- a/packages/transaction-controller/src/helpers/ResimulateHelper.ts +++ b/packages/transaction-controller/src/helpers/ResimulateHelper.ts @@ -88,7 +88,6 @@ export class ResimulateHelper { } const listener = () => { - // eslint-disable-next-line promise/catch-or-return this.#simulateTransaction(transactionMeta) .catch((error) => { /* istanbul ignore next */ diff --git a/packages/user-operation-controller/src/UserOperationController.test.ts b/packages/user-operation-controller/src/UserOperationController.test.ts index 07a7ee0d4a2..743a6c9e911 100644 --- a/packages/user-operation-controller/src/UserOperationController.test.ts +++ b/packages/user-operation-controller/src/UserOperationController.test.ts @@ -98,6 +98,7 @@ const ADD_USER_OPERATION_OPTIONS_MOCK: AddUserOperationOptions = { /** * Creates a mock user operation messenger. + * * @returns The mock user operation messenger. */ function createMessengerMock() { @@ -111,6 +112,7 @@ function createMessengerMock() { /** * Creates a mock smart contract account. + * * @returns The mock smart contract account. */ function createSmartContractAccountMock() { @@ -123,6 +125,7 @@ function createSmartContractAccountMock() { /** * Creates a mock bundler. + * * @returns The mock bundler. */ function createBundlerMock() { @@ -134,6 +137,7 @@ function createBundlerMock() { /** * Creates a mock PendingUserOperationTracker. + * * @returns The mock PendingUserOperationTracker. */ function createPendingUserOperationTrackerMock() { @@ -238,7 +242,7 @@ describe('UserOperationController', () => { } // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + throw new Error(`Unexpected mock messenger action: ${action}`); }, ); diff --git a/packages/user-operation-controller/src/UserOperationController.ts b/packages/user-operation-controller/src/UserOperationController.ts index 7a55e632753..adad6364ced 100644 --- a/packages/user-operation-controller/src/UserOperationController.ts +++ b/packages/user-operation-controller/src/UserOperationController.ts @@ -83,21 +83,21 @@ type Events = { export type UserOperationControllerEventEmitter = EventEmitter & { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + on( eventName: T, listener: (...args: Events[T]) => void, ): UserOperationControllerEventEmitter; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + once( eventName: T, listener: (...args: Events[T]) => void, ): UserOperationControllerEventEmitter; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + emit(eventName: T, ...args: Events[T]): boolean; }; @@ -205,11 +205,11 @@ export class UserOperationController extends BaseController< > { hub: UserOperationControllerEventEmitter; - #entrypoint: string; + readonly #entrypoint: string; - #getGasFeeEstimates: () => Promise; + readonly #getGasFeeEstimates: () => Promise; - #pendingUserOperationTracker: PendingUserOperationTracker; + readonly #pendingUserOperationTracker: PendingUserOperationTracker; /** * Construct a UserOperationController instance. @@ -712,7 +712,7 @@ export class UserOperationController extends BaseController< log('In listener...'); this.hub.emit('user-operation-confirmed', metadata); // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + this.hub.emit(`${metadata.id}:confirmed`, metadata); }, ); @@ -722,7 +722,7 @@ export class UserOperationController extends BaseController< (metadata, error) => { this.hub.emit('user-operation-failed', metadata, error); // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + this.hub.emit(`${metadata.id}:failed`, metadata, error); }, ); diff --git a/packages/user-operation-controller/src/helpers/Bundler.test.ts b/packages/user-operation-controller/src/helpers/Bundler.test.ts index d629a025bb3..8572894b439 100644 --- a/packages/user-operation-controller/src/helpers/Bundler.test.ts +++ b/packages/user-operation-controller/src/helpers/Bundler.test.ts @@ -1,5 +1,5 @@ -import type { UserOperation } from '../types'; import { Bundler } from './Bundler'; +import type { UserOperation } from '../types'; const URL_MOCK = 'http://test.com'; const ENTRYPOINT_MOCK = '0x123'; @@ -46,6 +46,7 @@ describe('Bundler', () => { /** * Mock fetch to return a JSON response. + * * @param jsonResponse - The JSON response to return. */ function mockJsonResponse(jsonResponse: Record) { diff --git a/packages/user-operation-controller/src/helpers/Bundler.ts b/packages/user-operation-controller/src/helpers/Bundler.ts index 2b800cd3a6d..9d98e3361bd 100644 --- a/packages/user-operation-controller/src/helpers/Bundler.ts +++ b/packages/user-operation-controller/src/helpers/Bundler.ts @@ -1,5 +1,3 @@ -/* eslint-disable jsdoc/require-jsdoc */ - import { createModuleLogger, projectLogger } from '../logger'; import type { UserOperation, UserOperationReceipt } from '../types'; @@ -27,7 +25,7 @@ export type BundlerEstimateUserOperationGasResponse = { * A helper class for interacting with a bundler. */ export class Bundler { - #url: string; + readonly #url: string; constructor(url: string) { this.#url = url; @@ -58,6 +56,7 @@ export class Bundler { /** * Retrieve the receipt for a user operation. + * * @param hash - The hash of the user operation. * @returns The receipt for the user operation, or `undefined` if the user operation is pending. */ @@ -74,6 +73,7 @@ export class Bundler { /** * Submit a user operation to the bundler. + * * @param userOperation - The signed user operation to submit. * @param entrypoint - The address of entrypoint to use for the user operation. * @returns The hash of the user operation. @@ -99,7 +99,7 @@ export class Bundler { } // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + async #query(method: string, params: unknown[]): Promise { const request = { method: 'POST', diff --git a/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.test.ts b/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.test.ts index 3291e07fdb8..f74254646f8 100644 --- a/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.test.ts +++ b/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.test.ts @@ -1,11 +1,11 @@ import { query } from '@metamask/controller-utils'; import type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller'; +import * as BundlerHelper from './Bundler'; +import { PendingUserOperationTracker } from './PendingUserOperationTracker'; import type { UserOperationMetadata, UserOperationReceipt } from '../types'; import { UserOperationStatus } from '../types'; import type { UserOperationControllerMessenger } from '../UserOperationController'; -import * as BundlerHelper from './Bundler'; -import { PendingUserOperationTracker } from './PendingUserOperationTracker'; const CHAIN_ID_MOCK = '0x5'; const NETWORK_CLIENT_ID_MOCK = 'testNetworkClientId'; @@ -44,6 +44,7 @@ jest.mock('@metamask/controller-utils', () => ({ /** * Creates a mock user operation messenger. + * * @returns The mock user operation messenger. */ function createMessengerMock() { @@ -55,6 +56,7 @@ function createMessengerMock() { /** * Creates a mock bundler. + * * @returns The mock bundler. */ function createBundlerMock() { @@ -70,6 +72,7 @@ describe('PendingUserOperationTracker', () => { /** * Simulate the scenario where a user operation is confirmed. + * * @param beforeCallback - An optional callback to execute before the scenario is run. * @param overrideReceipt - An optional receipt to override the default mock receipt. */ @@ -100,6 +103,7 @@ describe('PendingUserOperationTracker', () => { /** * Simulate the scenario where a user operation fails. + * * @param beforeCallback - An optional callback to execute before the scenario is run. */ async function onFailedUserOperation( @@ -131,7 +135,9 @@ describe('PendingUserOperationTracker', () => { blockTracker: { getCurrentBlock: () => BLOCK_NUMBER_MOCK }, configuration: { chainId: CHAIN_ID_MOCK }, provider: {}, - } as unknown as ReturnType); + } as unknown as ReturnType< + NetworkControllerGetNetworkClientByIdAction['handler'] + >); }); describe('_executePoll', () => { diff --git a/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts b/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts index 551ac6736a1..cda8beac582 100644 --- a/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts +++ b/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts @@ -11,11 +11,11 @@ import { createModuleLogger, type Hex } from '@metamask/utils'; // eslint-disable-next-line import-x/no-nodejs-modules import EventEmitter from 'events'; +import { Bundler } from './Bundler'; import { projectLogger } from '../logger'; import type { UserOperationMetadata, UserOperationReceipt } from '../types'; import { UserOperationStatus } from '../types'; import type { UserOperationControllerMessenger } from '../UserOperationController'; -import { Bundler } from './Bundler'; const log = createModuleLogger(projectLogger, 'pending-user-operations'); @@ -27,21 +27,21 @@ type Events = { export type PendingUserOperationTrackerEventEmitter = EventEmitter & { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + on( eventName: T, listener: (...args: Events[T]) => void, ): PendingUserOperationTrackerEventEmitter; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + once( eventName: T, listener: (...args: Events[T]) => void, ): PendingUserOperationTrackerEventEmitter; // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + emit(eventName: T, ...args: Events[T]): boolean; }; @@ -57,9 +57,9 @@ type PendingUserOperationPollingInput = { export class PendingUserOperationTracker extends BlockTrackerPollingControllerOnly() { hub: PendingUserOperationTrackerEventEmitter; - #getUserOperations: () => UserOperationMetadata[]; + readonly #getUserOperations: () => UserOperationMetadata[]; - #messenger: UserOperationControllerMessenger; + readonly #messenger: UserOperationControllerMessenger; constructor({ getUserOperations, diff --git a/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts b/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts index 11475aa0386..e958ed1e33b 100644 --- a/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts +++ b/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts @@ -1,5 +1,6 @@ import type { KeyringController } from '@metamask/keyring-controller'; +import { SnapSmartContractAccount } from './SnapSmartContractAccount'; import { ADDRESS_ZERO, EMPTY_BYTES, VALUE_ZERO } from '../constants'; import type { PrepareUserOperationResponse, @@ -11,7 +12,6 @@ import type { import { type PrepareUserOperationRequest } from '../types'; import type { UserOperationControllerMessenger } from '../UserOperationController'; import { toEip155ChainId } from '../utils/chain-id'; -import { SnapSmartContractAccount } from './SnapSmartContractAccount'; const PREPARE_USER_OPERATION_REQUEST_MOCK: PrepareUserOperationRequest = { chainId: '0x1', @@ -74,6 +74,7 @@ const SIGN_USER_OPERATION_RESPONSE_MOCK: Awaited< /** * Creates a mock of the UserOperationControllerMessenger. + * * @returns The mock instance. */ function createMessengerMock() { diff --git a/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.ts b/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.ts index f4bf60de2d4..78cddc4ccd7 100644 --- a/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.ts +++ b/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.ts @@ -12,7 +12,7 @@ import type { UserOperationControllerMessenger } from '../UserOperationControlle import { toEip155ChainId } from '../utils/chain-id'; export class SnapSmartContractAccount implements SmartContractAccount { - #messenger: UserOperationControllerMessenger; + readonly #messenger: UserOperationControllerMessenger; constructor(messenger: UserOperationControllerMessenger) { this.#messenger = messenger; diff --git a/packages/user-operation-controller/src/types.ts b/packages/user-operation-controller/src/types.ts index 0e827cc3c19..b4f66cf0f40 100644 --- a/packages/user-operation-controller/src/types.ts +++ b/packages/user-operation-controller/src/types.ts @@ -283,6 +283,7 @@ export type SignUserOperationResponse = { export type SmartContractAccount = { /** * Retrieve the initial values required to create a user operation. + * * @param request - The data needed by the smart contract account to provide the initial user operation values. * @returns The initial values required to create a user operation. */ @@ -293,6 +294,7 @@ export type SmartContractAccount = { /** * Retrieve additional data required to create a user operation, such as the paymasterAndData value. * If gas values were not provided in the prepare response, this will be called after estimating gas using the bundler. + * * @param request - The data needed by the smart contract account to provide the additional user operation values. * @returns The additional values required to create a user operation. */ @@ -302,6 +304,7 @@ export type SmartContractAccount = { /** * Sign the final user operation. + * * @param request - The data needed by the smart contract account to generate the signature. * @returns The final values required to sign a user operation. */ diff --git a/packages/user-operation-controller/src/utils/gas-fees.ts b/packages/user-operation-controller/src/utils/gas-fees.ts index 8cb9876892b..a86c980aee8 100644 --- a/packages/user-operation-controller/src/utils/gas-fees.ts +++ b/packages/user-operation-controller/src/utils/gas-fees.ts @@ -37,6 +37,7 @@ type SuggestedGasFees = { /** * Populates the gas fee properties for a user operation. + * * @param request - The request to update the gas fees. * @param request.getGasFeeEstimates - A callback to get gas fee estimates. * @param request.metadata - The metadata for the user operation. @@ -80,6 +81,7 @@ export async function updateGasFees(request: UpdateGasFeesRequest) { /** * Gets the maxFeePerGas for a user operation. + * * @param originalRequest - The original request to add the user operation. * @param getGetFasEstimates - A callback to get gas fee estimates. * @param transaction - The transaction that created the user operation. @@ -116,6 +118,7 @@ async function getMaxFeePerGas( /** * Gets the maxPriorityFeePerGas for a user operation. + * * @param originalRequest - The original request to add the user operation. * @param getGetFasEstimates - A callback to get gas fee estimates. * @param userOperation - The user operation being updated. @@ -160,6 +163,7 @@ async function getMaxPriorityFeePerGas( /** * Gets the userFeeLevel for a user operation. + * * @param metadata - The metadata for the user operation. * @param originalRequest - The original request to add the user operation. * @param suggestedGasFees - The suggested gas fees, if any. @@ -208,6 +212,7 @@ function getUserFeeLevel( /** * Gets suggested gas fees. + * * @param request - The request to update the gas fees. * @param request.getGasFeeEstimates - A callback to get gas fee estimates. * @param request.provider - A provider to query the network. @@ -281,6 +286,7 @@ async function getSuggestedGasFees( /** * Converts a GWEI decimal string to a WEI hexadecimal string. + * * @param value - The GWEI decimal string to convert. * @returns The WEI hexadecimal string. */ @@ -290,6 +296,7 @@ function gweiDecimalToWeiHex(value: string) { /** * Checks if a gas fee property is empty. + * * @param value - The gas fee value to check. * @returns Whether the gas fee property is empty. */ diff --git a/packages/user-operation-controller/src/utils/gas.test.ts b/packages/user-operation-controller/src/utils/gas.test.ts index bb40ac09873..a4ec99dce68 100644 --- a/packages/user-operation-controller/src/utils/gas.test.ts +++ b/packages/user-operation-controller/src/utils/gas.test.ts @@ -1,5 +1,6 @@ import { cloneDeep } from 'lodash'; +import { updateGas } from './gas'; import { VALUE_ZERO } from '../constants'; import type { BundlerEstimateUserOperationGasResponse } from '../helpers/Bundler'; import { Bundler } from '../helpers/Bundler'; @@ -7,7 +8,6 @@ import type { PrepareUserOperationResponse, UserOperationMetadata, } from '../types'; -import { updateGas } from './gas'; jest.mock('../helpers/Bundler', () => ({ Bundler: jest.fn(), @@ -36,6 +36,7 @@ const ESTIMATE_RESPONSE_HEX_MOCK: BundlerEstimateUserOperationGasResponse = { /** * Creates a mock bundler. + * * @returns The mock bundler. */ function createBundlerMock() { diff --git a/packages/user-operation-controller/src/utils/gas.ts b/packages/user-operation-controller/src/utils/gas.ts index 94ca9d70f91..3d5715832fc 100644 --- a/packages/user-operation-controller/src/utils/gas.ts +++ b/packages/user-operation-controller/src/utils/gas.ts @@ -19,6 +19,7 @@ const GAS_ESTIMATE_MULTIPLIER = 1.5; /** * Populates the gas properties for a user operation. + * * @param metadata - The metadata for the user operation. * @param prepareResponse - The prepare response from the smart contract account. * @param entrypoint - Address of the entrypoint contract. @@ -78,6 +79,7 @@ export async function updateGas( /** * Normalizes a gas estimate value from the bundler. + * * @param rawValue - The raw value to normalize. * @returns The normalized value as a hexadecimal string. */ diff --git a/packages/user-operation-controller/src/utils/transaction.test.ts b/packages/user-operation-controller/src/utils/transaction.test.ts index 1decdee6216..50b7e6b146d 100644 --- a/packages/user-operation-controller/src/utils/transaction.test.ts +++ b/packages/user-operation-controller/src/utils/transaction.test.ts @@ -1,3 +1,4 @@ +import { getTransactionMetadata } from './transaction'; import type { TransactionParams } from '../../../transaction-controller/src'; import { TransactionStatus, @@ -7,7 +8,6 @@ import { import { EMPTY_BYTES, VALUE_ZERO } from '../constants'; import type { UserOperation } from '../types'; import { UserOperationStatus, type UserOperationMetadata } from '../types'; -import { getTransactionMetadata } from './transaction'; const USER_OPERATION_METADATA_MOCK: UserOperationMetadata = { id: 'testUserOperationId', diff --git a/packages/user-operation-controller/src/utils/transaction.ts b/packages/user-operation-controller/src/utils/transaction.ts index 0e606536af6..72e90be3cec 100644 --- a/packages/user-operation-controller/src/utils/transaction.ts +++ b/packages/user-operation-controller/src/utils/transaction.ts @@ -17,6 +17,7 @@ import type { UserOperationMetadata } from '../types'; /** * Converts a user operation metadata object into a transaction metadata object. + * * @param metadata - The user operation metadata object to convert. * @returns The equivalent transaction metadata object. */ @@ -148,6 +149,7 @@ export function getTransactionMetadata( /** * Adds the given hexadecimal values together. + * * @param values - The hexadecimal values to add together. * @returns The sum of the given hexadecimal values. */ diff --git a/packages/user-operation-controller/src/utils/validation.test.ts b/packages/user-operation-controller/src/utils/validation.test.ts index 180221394f3..93b59dfdd6c 100644 --- a/packages/user-operation-controller/src/utils/validation.test.ts +++ b/packages/user-operation-controller/src/utils/validation.test.ts @@ -3,6 +3,13 @@ import { TransactionType } from '@metamask/transaction-controller'; import { cloneDeep } from 'lodash'; +import { + validateAddUserOperationOptions, + validateAddUserOperationRequest, + validatePrepareUserOperationResponse, + validateSignUserOperationResponse, + validateUpdateUserOperationResponse, +} from './validation'; import type { PrepareUserOperationResponse, SignUserOperationResponse, @@ -12,13 +19,6 @@ import type { AddUserOperationOptions, AddUserOperationRequest, } from '../UserOperationController'; -import { - validateAddUserOperationOptions, - validateAddUserOperationRequest, - validatePrepareUserOperationResponse, - validateSignUserOperationResponse, - validateUpdateUserOperationResponse, -} from './validation'; const ADD_USER_OPERATION_REQUEST_MOCK: AddUserOperationRequest = { data: '0x1', @@ -65,13 +65,14 @@ const SIGN_USER_OPERATION_RESPONSE_MOCK: SignUserOperationResponse = { /** * Copy an object and set a property path to a given value. + * * @param object - The object to copy. * @param pathString - The property path to set. * @param value - The value to set. * @returns The copied object with the property path set to the given value. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + function setPropertyPath(object: T, pathString: string, value: unknown): T { const copy = cloneDeep(object); const path = pathString.split('.'); @@ -89,6 +90,7 @@ function setPropertyPath(object: T, pathString: string, value: unknown): T { /** * Expect a validation error to be thrown. + * * @param validateFunction - The validation function to call. * @param input - The input to validate. * @param propertyName - The property name to set. @@ -98,7 +100,7 @@ function setPropertyPath(object: T, pathString: string, value: unknown): T { * @param rootPropertyName - The name of the root input. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + function expectValidationError( validateFunction: (request: T) => void, input: T, diff --git a/packages/user-operation-controller/src/utils/validation.ts b/packages/user-operation-controller/src/utils/validation.ts index 88a8ac5dd14..b39f443a958 100644 --- a/packages/user-operation-controller/src/utils/validation.ts +++ b/packages/user-operation-controller/src/utils/validation.ts @@ -27,6 +27,7 @@ import type { /** * Validate a request to add a user operation. + * * @param request - The request to validate. */ export function validateAddUserOperationRequest( @@ -49,6 +50,7 @@ export function validateAddUserOperationRequest( /** * Validate the options when adding a user operation. + * * @param options - The options to validate. */ export function validateAddUserOperationOptions( @@ -90,6 +92,7 @@ export function validateAddUserOperationOptions( /** * Validate the response from a smart contract account when preparing the user operation. + * * @param response - The response to validate. */ export function validatePrepareUserOperationResponse( @@ -135,6 +138,7 @@ export function validatePrepareUserOperationResponse( /** * Validate the response from a smart contract account when updating the user operation. + * * @param response - The response to validate. */ export function validateUpdateUserOperationResponse( @@ -158,6 +162,7 @@ export function validateUpdateUserOperationResponse( /** * Validate the response from a smart contract account when signing the user operation. + * * @param response - The response to validate. */ export function validateSignUserOperationResponse( @@ -178,12 +183,13 @@ export function validateSignUserOperationResponse( /** * Validate data against a struct. + * * @param data - The data to validate. * @param struct - The struct to validate against. * @param message - The message to throw if validation fails. */ // TODO: Either fix this lint violation or explain why it's necessary to ignore. -// eslint-disable-next-line @typescript-eslint/naming-convention + function validate(data: unknown, struct: Struct, message: string) { try { assert(data, struct, message); @@ -207,6 +213,7 @@ function validate(data: unknown, struct: Struct, message: string) { /** * Define the Hex type used by superstruct. + * * @returns The Hex superstruct type. */ function defineHex() { @@ -217,6 +224,7 @@ function defineHex() { /** * Define the HexOrEmptyBytes type used by superstruct. + * * @returns The HexOrEmptyBytes superstruct type. */ function defineHexOrEmptyBytes() { diff --git a/scripts/create-package/cli.test.ts b/scripts/create-package/cli.test.ts index f366586fc08..19fe760cdcc 100644 --- a/scripts/create-package/cli.test.ts +++ b/scripts/create-package/cli.test.ts @@ -26,7 +26,7 @@ function getMockArgv(...args: string[]) { function getParsedArgv(name: string, description: string) { return { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + _: [], $0: 'create-package', name: `@metamask/${name}`, diff --git a/scripts/create-package/commands.test.ts b/scripts/create-package/commands.test.ts index e557dd51506..980bd6be09f 100644 --- a/scripts/create-package/commands.test.ts +++ b/scripts/create-package/commands.test.ts @@ -27,7 +27,7 @@ describe('create-package/commands', () => { const args: Arguments = { // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/naming-convention + _: [], $0: 'create-package', name: '@metamask/new-package', diff --git a/scripts/create-package/utils.ts b/scripts/create-package/utils.ts index 935342ec2aa..8ea5355fcac 100644 --- a/scripts/create-package/utils.ts +++ b/scripts/create-package/utils.ts @@ -22,10 +22,9 @@ const allPlaceholdersRegex = new RegExp( // Our lint config really hates this, but it works. // eslint-disable-next-line -const prettierRc = require(path.join( - REPO_ROOT, - '.prettierrc.js', -)) as PrettierOptions; +const prettierRc = require( + path.join(REPO_ROOT, '.prettierrc.js'), +) as PrettierOptions; /** * The data necessary to create a new package. diff --git a/tests/fake-block-tracker.ts b/tests/fake-block-tracker.ts index 76b29df8af0..1c42fd84ecb 100644 --- a/tests/fake-block-tracker.ts +++ b/tests/fake-block-tracker.ts @@ -20,7 +20,7 @@ export class FakeBlockTracker< }); // Don't start the polling loop // TODO: Replace `any` with type - // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any (this as any).start = () => {}; } diff --git a/tests/fake-provider.ts b/tests/fake-provider.ts index 6122dbe681b..0077eaa0efa 100644 --- a/tests/fake-provider.ts +++ b/tests/fake-provider.ts @@ -43,13 +43,18 @@ export type FakeProviderResponse = { result: any } | { error: string }; * throw an error, and if it returns a promise, that promise can either be * resolved with a response object or reject with an error. * - * @property request - Looks for a request matching these specifications. - * @property request.method - The RPC method to which this stub will be matched. - * @property request.params - The params to which this stub will be matched. - * @property response - Instructs `request` to return a promise that resolves + * request - Looks for a request matching these specifications. + * + * request.method - The RPC method to which this stub will be matched. + * + * request.params - The params to which this stub will be matched. + * + * response - Instructs `request` to return a promise that resolves * with a response object. - * @property response.result - Specifies a successful response, with this as the + * + * response.result - Specifies a successful response, with this as the * `result`. + * * @property response.error - Specifies an error response, with this as the * `error`. * @property error - Instructs `request` to return a promise that rejects with @@ -91,7 +96,7 @@ export type FakeProviderStub = { /** * The set of options that the FakeProvider constructor takes. * - * @property stubs - A set of objects that allow specifying the behavior + * stubs - A set of objects that allow specifying the behavior * of specific invocations of `request` matching a `method`. */ type FakeProviderEngineOptions = { @@ -124,9 +129,9 @@ export class FakeProvider { calledStubs: FakeProviderStub[]; - #originalStubs: FakeProviderStub[]; + readonly #originalStubs: FakeProviderStub[]; - #stubs: FakeProviderStub[]; + readonly #stubs: FakeProviderStub[]; /** * Makes a new instance of the fake provider. diff --git a/tests/mock-network.ts b/tests/mock-network.ts index 85984f67173..65f6944500c 100644 --- a/tests/mock-network.ts +++ b/tests/mock-network.ts @@ -8,12 +8,17 @@ import { NetworkClientType } from '../packages/network-controller/src/types'; * An object which instructs the MockedNetwork class which JSON-RPC request * should be mocked and how that request should respond. * - * @property request - The JSON-RPC request that should be mocked. - * @property request.method - The JSON-RPC method. - * @property request.params - The JSON-RPC params (optional). - * @property response - The JSON-RPC response that the request should return. - * @property response.result - Specifies the `result` field of the JSON-RPC + * request - The JSON-RPC request that should be mocked. + * + * request.method - The JSON-RPC method. + * + * request.params - The JSON-RPC params (optional). + * + * response - The JSON-RPC response that the request should return. + * + * response.result - Specifies the `result` field of the JSON-RPC * response. + * * @property response.error - Specifies the `error` field of the JSON-RPC * response. * @property error - The error that should be raised upon making the request. @@ -82,11 +87,11 @@ function getErrorMessage(error: unknown): string { * JSON-RPC requests that are sent to a network. */ class MockedNetwork { - #networkClientConfiguration: NetworkClientConfiguration; + readonly #networkClientConfiguration: NetworkClientConfiguration; - #requestMocks: JsonRpcRequestMock[]; + readonly #requestMocks: JsonRpcRequestMock[]; - #nockScope: nock.Scope; + readonly #nockScope: nock.Scope; readonly #rpcUrl: string; @@ -111,7 +116,7 @@ class MockedNetwork { const rpcUrl = networkClientConfiguration.type === 'infura' ? // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `https://${networkClientConfiguration.network}.infura.io` : networkClientConfiguration.rpcUrl; this.#nockScope = nock(rpcUrl); diff --git a/tests/setupAfterEnv/matchers.ts b/tests/setupAfterEnv/matchers.ts index 8acf1206dd5..b73551d64fc 100644 --- a/tests/setupAfterEnv/matchers.ts +++ b/tests/setupAfterEnv/matchers.ts @@ -52,7 +52,7 @@ expect.extend({ return { message: () => // TODO: Either fix this lint violation or explain why it's necessary to ignore. - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + `Expected promise to be fulfilled, but it was rejected with ${rejectionValue}.`, pass: false, }; @@ -111,11 +111,10 @@ expect.extend({ message: () => { return `Expected promise to never resolve after ${TIME_TO_WAIT_UNTIL_UNRESOLVED}ms, but it ${ // TODO: Either fix this lint violation or explain why it's necessary to ignore. - /* eslint-disable @typescript-eslint/restrict-template-expressions */ + rejectionValue ? `was rejected with ${rejectionValue}` : `resolved with ${resolutionValue}` - /* eslint-enable @typescript-eslint/restrict-template-expressions */ }`; }, pass: false, From 1f393a19acc389638b1438cdbab53eab2c256d94 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 10 Nov 2025 14:09:37 -0330 Subject: [PATCH 2/6] Remove unused comments and undo broken JSDoc changes --- eslint-warning-thresholds.json | 35 +++++-- .../src/ApprovalController.ts | 1 - .../src/NftController.test.ts | 6 -- .../src/NftDetectionController.test.ts | 12 --- .../src/NftDetectionController.ts | 97 ++++--------------- .../src/RatesController/RatesController.ts | 2 - .../src/TokenDetectionController.test.ts | 4 - .../src/TokenListController.test.ts | 2 - .../src/TokenRatesController.ts | 16 ++- .../src/TokensController.test.ts | 2 - .../src/TokensController.ts | 34 ++----- .../assets-controllers/src/assetsUtil.test.ts | 2 - packages/assets-controllers/src/assetsUtil.ts | 46 --------- .../crypto-compare-service/crypto-compare.ts | 6 -- .../base-controller/src/BaseController.ts | 4 - packages/controller-utils/src/siwe.ts | 9 +- packages/controller-utils/src/util.test.ts | 2 - packages/controller-utils/src/util.ts | 10 -- .../ens-controller/src/EnsController.test.ts | 2 - packages/ens-controller/src/EnsController.ts | 10 +- .../src/GasFeeController.test.ts | 12 --- .../src/GasFeeController.ts | 40 +++----- .../src/AbstractMessageManager.ts | 61 +++++------- .../src/DecryptMessageManager.ts | 28 +++--- .../src/EncryptionPublicKeyManager.ts | 34 +++---- .../name-controller/src/NameController.ts | 4 - .../src/providers/etherscan.ts | 26 ----- packages/name-controller/src/types.ts | 2 - packages/name-controller/src/util.ts | 2 - .../src/PermissionLogController.ts | 11 +-- .../permission-log-controller/src/enums.ts | 6 -- .../tests/helpers.ts | 32 ------ .../src/PhishingController.ts | 54 ++++------- .../src/AbstractPollingController.ts | 2 - .../src/BlockTrackerPollingController.ts | 4 - .../src/StaticIntervalPollingController.ts | 2 - .../src/RateLimitController.ts | 10 +- .../src/utils/validation.test.ts | 2 - .../src/UserOperationController.test.ts | 2 - .../src/UserOperationController.ts | 10 -- .../src/helpers/Bundler.ts | 2 - .../helpers/PendingUserOperationTracker.ts | 6 -- .../src/utils/validation.test.ts | 4 - .../src/utils/validation.ts | 2 - scripts/create-package/cli.test.ts | 2 - scripts/create-package/commands.test.ts | 2 - tests/fake-provider.ts | 18 ++-- tests/mock-network.ts | 19 ++-- tests/setupAfterEnv/matchers.ts | 4 - 49 files changed, 164 insertions(+), 541 deletions(-) diff --git a/eslint-warning-thresholds.json b/eslint-warning-thresholds.json index 95f8f10b4ec..698da877607 100644 --- a/eslint-warning-thresholds.json +++ b/eslint-warning-thresholds.json @@ -45,7 +45,7 @@ "import-x/namespace": 6 }, "packages/assets-controllers/src/NftDetectionController.ts": { - "jsdoc/check-tag-names": 16 + "jsdoc/check-tag-names": 34 }, "packages/assets-controllers/src/Standards/ERC20Standard.test.ts": { "jest/no-commented-out-tests": 1 @@ -64,7 +64,7 @@ "jest/no-conditional-in-test": 2 }, "packages/assets-controllers/src/TokenRatesController.ts": { - "jsdoc/check-tag-names": 4 + "jsdoc/check-tag-names": 10 }, "packages/assets-controllers/src/TokensController.test.ts": { "import-x/namespace": 1, @@ -72,7 +72,7 @@ }, "packages/assets-controllers/src/TokensController.ts": { "@typescript-eslint/no-unused-vars": 1, - "jsdoc/check-tag-names": 1 + "jsdoc/check-tag-names": 10 }, "packages/assets-controllers/src/assetsUtil.test.ts": { "jest/no-conditional-in-test": 2 @@ -98,7 +98,8 @@ "no-shadow": 2 }, "packages/controller-utils/src/siwe.ts": { - "@typescript-eslint/no-unused-vars": 1 + "@typescript-eslint/no-unused-vars": 1, + "jsdoc/check-tag-names": 4 }, "packages/controller-utils/src/util.test.ts": { "import-x/no-named-as-default": 1, @@ -114,6 +115,9 @@ "packages/eip-5792-middleware/src/hooks/processSendCalls.ts": { "@typescript-eslint/no-misused-promises": 1 }, + "packages/ens-controller/src/EnsController.ts": { + "jsdoc/check-tag-names": 3 + }, "packages/eth-block-tracker/src/PollingBlockTracker.test.ts": { "@typescript-eslint/unbound-method": 4 }, @@ -218,7 +222,7 @@ "import-x/namespace": 2 }, "packages/gas-fee-controller/src/GasFeeController.ts": { - "jsdoc/check-tag-names": 1 + "jsdoc/check-tag-names": 14 }, "packages/json-rpc-middleware-stream/src/index.test.ts": { "@typescript-eslint/prefer-promise-reject-errors": 1, @@ -242,14 +246,21 @@ "jest/no-conditional-in-test": 7 }, "packages/message-manager/src/AbstractMessageManager.ts": { - "jsdoc/check-tag-names": 1 + "jsdoc/check-tag-names": 25, + "jsdoc/tag-lines": 2 }, "packages/message-manager/src/DecryptMessageManager.test.ts": { "jest/no-conditional-in-test": 3 }, + "packages/message-manager/src/DecryptMessageManager.ts": { + "jsdoc/check-tag-names": 11 + }, "packages/message-manager/src/EncryptionPublicKeyManager.test.ts": { "jest/no-conditional-in-test": 5 }, + "packages/message-manager/src/EncryptionPublicKeyManager.ts": { + "jsdoc/check-tag-names": 13 + }, "packages/message-manager/src/utils.ts": { "@typescript-eslint/no-unused-vars": 1 }, @@ -274,8 +285,11 @@ "packages/permission-controller/src/PermissionController.test.ts": { "jest/no-conditional-in-test": 4 }, + "packages/permission-log-controller/src/PermissionLogController.ts": { + "jsdoc/check-tag-names": 2 + }, "packages/phishing-controller/src/PhishingController.ts": { - "jsdoc/check-tag-names": 6 + "jsdoc/check-tag-names": 25 }, "packages/phishing-controller/src/utils.test.ts": { "import-x/namespace": 5 @@ -283,6 +297,9 @@ "packages/phishing-controller/src/utils.ts": { "@typescript-eslint/no-unsafe-enum-comparison": 1 }, + "packages/rate-limit-controller/src/RateLimitController.ts": { + "jsdoc/check-tag-names": 3 + }, "packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.test.ts": { "promise/param-names": 1 }, @@ -337,11 +354,11 @@ }, "tests/fake-provider.ts": { "@typescript-eslint/prefer-promise-reject-errors": 1, - "jsdoc/check-tag-names": 6 + "jsdoc/check-tag-names": 12 }, "tests/mock-network.ts": { "@typescript-eslint/no-unsafe-enum-comparison": 1, - "jsdoc/check-tag-names": 5 + "jsdoc/check-tag-names": 10 }, "tests/setupAfterEnv/nock.ts": { "import-x/no-named-as-default-member": 3 diff --git a/packages/approval-controller/src/ApprovalController.ts b/packages/approval-controller/src/ApprovalController.ts index 5a8e51277cd..582382cd9b7 100644 --- a/packages/approval-controller/src/ApprovalController.ts +++ b/packages/approval-controller/src/ApprovalController.ts @@ -615,7 +615,6 @@ export class ApprovalController extends BaseController< if (origin) { return Array.from( (this.#origins.get(origin) || new Map()).values(), - // TODO: Either fix this lint violation or explain why it's necessary to ignore. ).reduce((total, value) => total + value, 0); } diff --git a/packages/assets-controllers/src/NftController.test.ts b/packages/assets-controllers/src/NftController.test.ts index 193cf979dd5..09b37101869 100644 --- a/packages/assets-controllers/src/NftController.test.ts +++ b/packages/assets-controllers/src/NftController.test.ts @@ -583,8 +583,6 @@ describe('NftController', () => { 'mainnet', ); await expect(erc721Result).rejects.toThrow( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `Suggested NFT of type ${ERC721} does not match received type ${ERC1155}`, ); }); @@ -2485,12 +2483,8 @@ describe('NftController', () => { .reply(200, { name: 'name (directly from tokenURI)', description: 'description (directly from tokenURI)', - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - external_link: null, image: 'image (directly from tokenURI)', - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - animation_url: null, }); diff --git a/packages/assets-controllers/src/NftDetectionController.test.ts b/packages/assets-controllers/src/NftDetectionController.test.ts index 58424bdfe22..fa4101e778f 100644 --- a/packages/assets-controllers/src/NftDetectionController.test.ts +++ b/packages/assets-controllers/src/NftDetectionController.test.ts @@ -222,8 +222,6 @@ describe('NftDetectionController', () => { }, }, blockaidResult: { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - result_type: BlockaidResultType.Benign, }, }, @@ -247,8 +245,6 @@ describe('NftDetectionController', () => { }, }, blockaidResult: { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - result_type: BlockaidResultType.Benign, }, }, @@ -279,8 +275,6 @@ describe('NftDetectionController', () => { }, }, blockaidResult: { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - result_type: BlockaidResultType.Benign, }, }, @@ -321,8 +315,6 @@ describe('NftDetectionController', () => { isSpam: false, }, blockaidResult: { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - result_type: BlockaidResultType.Malicious, }, }, @@ -343,8 +335,6 @@ describe('NftDetectionController', () => { isSpam: true, }, blockaidResult: { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - result_type: BlockaidResultType.Benign, }, }, @@ -365,8 +355,6 @@ describe('NftDetectionController', () => { isSpam: true, }, blockaidResult: { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - result_type: BlockaidResultType.Malicious, }, }, diff --git a/packages/assets-controllers/src/NftDetectionController.ts b/packages/assets-controllers/src/NftDetectionController.ts index dfc55285575..cff23beeb25 100644 --- a/packages/assets-controllers/src/NftDetectionController.ts +++ b/packages/assets-controllers/src/NftDetectionController.ts @@ -75,17 +75,14 @@ const supportedNftDetectionNetworks: Set = new Set([ ]); /** - * ApiNft + * @type ApiNft * * NFT object coming from OpenSea api * - * token_id - The NFT identifier - * - * num_sales - Number of sales - * - * background_color - The background color to be displayed with the item - * - * image_url - URI of an image associated with this NFT + * @property token_id - The NFT identifier + * @property num_sales - Number of sales + * @property background_color - The background color to be displayed with the item + * @property image_url - URI of an image associated with this NFT * * @property image_preview_url - URI of a smaller image associated with this NFT * @property image_thumbnail_url - URI of a thumbnail image associated with this NFT @@ -100,60 +97,32 @@ const supportedNftDetectionNetworks: Set = new Set([ * @property lastSale - When this item was last sold */ export type ApiNft = { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - token_id: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - num_sales: number | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - background_color: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - image_url: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - image_preview_url: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - image_thumbnail_url: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - image_original_url: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - animation_url: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - animation_original_url: string | null; name: string | null; description: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - external_link: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - asset_contract: ApiNftContract; creator: ApiNftCreator; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - last_sale: ApiNftLastSale | null; }; /** - * ApiNftContract + * @type ApiNftContract * * NFT contract object coming from OpenSea api * - * address - Address of the NFT contract - * - * asset_contract_type - The NFT type, it could be `semi-fungible` or `non-fungible` - * - * created_date - Creation date - * - * collection - Object containing the contract name and URI of an image associated - * + * @property address - Address of the NFT contract + * @property asset_contract_type - The NFT type, it could be `semi-fungible` or `non-fungible` + * @property created_date - Creation date + * @property collection - Object containing the contract name and URI of an image associated * @property schema_name - The schema followed by the contract, it could be `ERC721` or `ERC1155` * @property symbol - The NFT contract symbol * @property total_supply - Total supply of NFTs @@ -162,70 +131,46 @@ export type ApiNft = { */ export type ApiNftContract = { address: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - asset_contract_type: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - created_date: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - schema_name: string | null; symbol: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - total_supply: string | null; description: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - external_link: string | null; collection: { name: string | null; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - image_url?: string | null; tokenCount?: string | null; }; }; /** - * ApiNftLastSale + * @type ApiNftLastSale * * NFT sale object coming from OpenSea api * - * event_timestamp - Object containing a `username` - * - * total_price - URI of NFT image associated with this owner - * - * transaction - Object containing transaction_hash and block_hash + * @property event_timestamp - Object containing a `username` + * @property total_price - URI of NFT image associated with this owner + * @property transaction - Object containing transaction_hash and block_hash */ export type ApiNftLastSale = { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - event_timestamp: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - total_price: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - transaction: { transaction_hash: string; block_hash: string }; }; /** - * ApiNftCreator + * @type ApiNftCreator * * NFT creator object coming from OpenSea api * - * user - Object containing a `username` - * - * profile_img_url - URI of NFT image associated with this owner - * - * address - The owner address + * @property user - Object containing a `username` + * @property profile_img_url - URI of NFT image associated with this owner + * @property address - The owner address */ export type ApiNftCreator = { user: { username: string }; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - profile_img_url: string; address: string; }; @@ -252,14 +197,8 @@ export enum BlockaidResultType { export type Blockaid = { contract: string; chainId: number; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - result_type: BlockaidResultType; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - malicious_score: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - attack_types: object; }; diff --git a/packages/assets-controllers/src/RatesController/RatesController.ts b/packages/assets-controllers/src/RatesController/RatesController.ts index cca988efb02..c7056cbe37a 100644 --- a/packages/assets-controllers/src/RatesController/RatesController.ts +++ b/packages/assets-controllers/src/RatesController/RatesController.ts @@ -119,8 +119,6 @@ export class RatesController extends BaseController< * // Execute criticalLogic within a lock. * const result = await this.#withLock(criticalLogic); */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - async #withLock(callback: () => R) { const releaseLock = await this.#mutex.acquire(); try { diff --git a/packages/assets-controllers/src/TokenDetectionController.test.ts b/packages/assets-controllers/src/TokenDetectionController.test.ts index 1db2d4e6e37..4ea7ed05065 100644 --- a/packages/assets-controllers/src/TokenDetectionController.test.ts +++ b/packages/assets-controllers/src/TokenDetectionController.test.ts @@ -2628,11 +2628,7 @@ describe('TokenDetectionController', () => { category: 'Wallet', properties: { tokens: [`${sampleTokenA.symbol} - ${sampleTokenA.address}`], - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - token_standard: 'ERC20', - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - asset_type: 'TOKEN', }, }); diff --git a/packages/assets-controllers/src/TokenListController.test.ts b/packages/assets-controllers/src/TokenListController.test.ts index 0989b61c0c2..9d0f5cecae0 100644 --- a/packages/assets-controllers/src/TokenListController.test.ts +++ b/packages/assets-controllers/src/TokenListController.test.ts @@ -1371,8 +1371,6 @@ describe('TokenListController', () => { * @returns The constructed path. */ function getTokensPath(chainId: Hex) { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - return `/tokens/${convertHexToDecimal( chainId, )}?occurrenceFloor=3&includeNativeAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`; diff --git a/packages/assets-controllers/src/TokenRatesController.ts b/packages/assets-controllers/src/TokenRatesController.ts index 91dac1145f5..eebaaf56482 100644 --- a/packages/assets-controllers/src/TokenRatesController.ts +++ b/packages/assets-controllers/src/TokenRatesController.ts @@ -38,14 +38,10 @@ import type { * * Token representation * - * address - Hex address of the token contract - * - * decimals - Number of decimals the token uses - * - * symbol - Symbol of the token - * - * aggregators - An array containing the token's aggregators - * + * @property address - Hex address of the token contract + * @property decimals - Number of decimals the token uses + * @property symbol - Symbol of the token + * @property aggregators - An array containing the token's aggregators * @property image - Image of the token, url or bit32 image * @property hasBalanceError - 'true' if there is an error while updating the token balance * @property isERC721 - 'true' if the token is a ERC721 token @@ -125,11 +121,11 @@ export type AllowedEvents = export const controllerName = 'TokenRatesController'; /** - * TokenRatesState + * @type TokenRatesState * * Token rates controller state * - * marketData - Market data for tokens, keyed by chain ID and then token contract address. + * @property marketData - Market data for tokens, keyed by chain ID and then token contract address. */ export type TokenRatesControllerState = { marketData: Record>; diff --git a/packages/assets-controllers/src/TokensController.test.ts b/packages/assets-controllers/src/TokensController.test.ts index fe99e38cf9d..538719c8382 100644 --- a/packages/assets-controllers/src/TokensController.test.ts +++ b/packages/assets-controllers/src/TokensController.test.ts @@ -1620,8 +1620,6 @@ describe('TokensController', () => { const fullErrorMessage = `TokenService Error: ${error}`; nock(TOKEN_END_POINT_API) .get( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `/token/${convertHexToDecimal( chainId, )}?address=${dummyTokenAddress}`, diff --git a/packages/assets-controllers/src/TokensController.ts b/packages/assets-controllers/src/TokensController.ts index 3868ba74d69..cafd25dc26b 100644 --- a/packages/assets-controllers/src/TokensController.ts +++ b/packages/assets-controllers/src/TokensController.ts @@ -58,18 +58,14 @@ import type { import type { Token } from './TokenRatesController'; /** - * SuggestedAssetMeta + * @type SuggestedAssetMeta * * Suggested asset by EIP747 meta data * - * id - Generated UUID associated with this suggested asset - * - * time - Timestamp associated with this this suggested asset - * - * type - Type type this suggested asset - * - * asset - Asset suggested object - * + * @property id - Generated UUID associated with this suggested asset + * @property time - Timestamp associated with this this suggested asset + * @property type - Type type this suggested asset + * @property asset - Asset suggested object * @property interactingAddress - Account address that requested watch asset */ type SuggestedAssetMeta = { @@ -81,15 +77,13 @@ type SuggestedAssetMeta = { }; /** - * TokensControllerState + * @type TokensControllerState * * Assets controller state * - * allTokens - Object containing tokens by network and account - * - * allIgnoredTokens - Object containing hidden/ignored tokens by network and account - * - * allDetectedTokens - Object containing tokens detected with non-zero balances + * @property allTokens - Object containing tokens by network and account + * @property allIgnoredTokens - Object containing hidden/ignored tokens by network and account + * @property allDetectedTokens - Object containing tokens detected with non-zero balances */ export type TokensControllerState = { allTokens: { [chainId: Hex]: { [key: string]: Token[] } }; @@ -872,8 +866,6 @@ export class TokensController extends BaseController< if (await this.#detectIsERC721(asset.address, networkClientId)) { throw rpcErrors.invalidParams( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `Contract ${asset.address} must match type ${type}, but was detected as ${ERC721}`, ); } @@ -886,8 +878,6 @@ export class TokensController extends BaseController< ); if (isErc1155) { throw rpcErrors.invalidParams( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `Contract ${asset.address} must match type ${type}, but was detected as ${ERC1155}`, ); } @@ -915,8 +905,6 @@ export class TokensController extends BaseController< asset.symbol.toUpperCase() !== contractSymbol.toUpperCase() ) { throw rpcErrors.invalidParams( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `The symbol in the request (${asset.symbol}) does not match the symbol in the contract (${contractSymbol})`, ); } @@ -946,8 +934,6 @@ export class TokensController extends BaseController< String(asset.decimals) !== contractDecimals ) { throw rpcErrors.invalidParams( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `The decimals in the request (${asset.decimals}) do not match the decimals in the contract (${contractDecimals})`, ); } @@ -956,8 +942,6 @@ export class TokensController extends BaseController< const decimalsNum = parseInt(decimalsStr as unknown as string, 10); if (!Number.isInteger(decimalsNum) || decimalsNum > 36 || decimalsNum < 0) { throw rpcErrors.invalidParams( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `Invalid decimals "${decimalsStr}": must be an integer 0 <= 36`, ); } diff --git a/packages/assets-controllers/src/assetsUtil.test.ts b/packages/assets-controllers/src/assetsUtil.test.ts index 824991e3f3e..e67bbb89280 100644 --- a/packages/assets-controllers/src/assetsUtil.test.ts +++ b/packages/assets-controllers/src/assetsUtil.test.ts @@ -152,8 +152,6 @@ describe('assetsUtil', () => { chainId: ChainId.mainnet, tokenAddress: linkTokenAddress, }); - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - const expectedValue = `https://static.cx.metamask.io/api/v1/tokenIcons/${convertHexToDecimal( ChainId.mainnet, )}/${linkTokenAddress}.png`; diff --git a/packages/assets-controllers/src/assetsUtil.ts b/packages/assets-controllers/src/assetsUtil.ts index 7e4a0e49693..6827486f631 100644 --- a/packages/assets-controllers/src/assetsUtil.ts +++ b/packages/assets-controllers/src/assetsUtil.ts @@ -130,8 +130,6 @@ export const formatIconUrlWithProxy = ({ tokenAddress: string; }) => { const chainIdDecimal = convertHexToDecimal(chainId).toString(); - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - return `https://static.cx.metamask.io/api/v1/tokenIcons/${chainIdDecimal}/${tokenAddress.toLowerCase()}.png`; }; @@ -139,65 +137,25 @@ export const formatIconUrlWithProxy = ({ * Networks where token detection is supported - Values are in hex format */ export enum SupportedTokenDetectionNetworks { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - mainnet = '0x1', // decimal: 1 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - bsc = '0x38', // decimal: 56 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - polygon = '0x89', // decimal: 137 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - avax = '0xa86a', // decimal: 43114 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - aurora = '0x4e454152', // decimal: 1313161554 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - linea_goerli = '0xe704', // decimal: 59140 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - linea_mainnet = '0xe708', // decimal: 59144 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - arbitrum = '0xa4b1', // decimal: 42161 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - optimism = '0xa', // decimal: 10 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - base = '0x2105', // decimal: 8453 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - zksync = '0x144', // decimal: 324 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - cronos = '0x19', // decimal: 25 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - celo = '0xa4ec', // decimal: 42220 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - gnosis = '0x64', // decimal: 100 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - fantom = '0xfa', // decimal: 250 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - polygon_zkevm = '0x44d', // decimal: 1101 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - moonbeam = '0x504', // decimal: 1284 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - moonriver = '0x505', // decimal: 1285 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - sei = '0x531', // decimal: 1329 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - monad_mainnet = '0x8f', // decimal: 143 } @@ -205,11 +163,7 @@ export enum SupportedTokenDetectionNetworks { * Networks where staked balance is supported - Values are in hex format */ export enum SupportedStakedBalanceNetworks { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - mainnet = '0x1', // decimal: 1 - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - hoodi = '0x88bb0', // decimal: 560048 } diff --git a/packages/assets-controllers/src/crypto-compare-service/crypto-compare.ts b/packages/assets-controllers/src/crypto-compare-service/crypto-compare.ts index e933556e602..b204d1fd31b 100644 --- a/packages/assets-controllers/src/crypto-compare-service/crypto-compare.ts +++ b/packages/assets-controllers/src/crypto-compare-service/crypto-compare.ts @@ -74,8 +74,6 @@ function getMultiPricingURL( * @param json.Response - The response status. * @param json.Message - The error message. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - function handleErrorResponse(json: { Response?: string; Message?: string }) { if (json.Response === 'Error') { throw new Error(json.Message); @@ -114,16 +112,12 @@ export async function fetchExchangeRate( if (!Number.isFinite(conversionRate)) { throw new Error( `Invalid response for ${currency.toUpperCase()}: ${ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - json[currency.toUpperCase()] }`, ); } if (includeUSDRate && !Number.isFinite(usdConversionRate)) { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - throw new Error(`Invalid response for usdConversionRate: ${json.USD}`); } diff --git a/packages/base-controller/src/BaseController.ts b/packages/base-controller/src/BaseController.ts index 8a60578815b..80370ba0292 100644 --- a/packages/base-controller/src/BaseController.ts +++ b/packages/base-controller/src/BaseController.ts @@ -40,8 +40,6 @@ export type StateChangeListener = (state: T, patches: Patch[]) => void; * @param value - A piece of controller state. * @returns Something derived from controller state. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export type StateDeriver = (value: T) => Json; /** @@ -50,8 +48,6 @@ export type StateDeriver = (value: T) => Json; * This metadata describes which parts of state should be persisted, and how to * get an anonymized representation of the state. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export type StateMetadata = { [P in keyof T]-?: StatePropertyMetadata; }; diff --git a/packages/controller-utils/src/siwe.ts b/packages/controller-utils/src/siwe.ts index f076313ccf5..1f4650e7f6b 100644 --- a/packages/controller-utils/src/siwe.ts +++ b/packages/controller-utils/src/siwe.ts @@ -41,11 +41,9 @@ function msgHexToText(hex: string): string { * * Sign-In With Ethereum (SIWE)(EIP-4361) message with request metadata * - * from - Subject account address - * - * origin - The RFC 3986 originating authority of the signing request, including scheme - * - * siwe - The data parsed from the message + * @property from - Subject account address + * @property origin - The RFC 3986 originating authority of the signing request, including scheme + * @property siwe - The data parsed from the message */ // This interface was created before this ESLint rule was added. // Convert to a `type` in a future major version. @@ -146,6 +144,7 @@ export const isValidSIWEOrigin = (req: WrappedSIWERequest): boolean => { /** * A locally defined object used to provide data to identify a Sign-In With Ethereum (SIWE)(EIP-4361) message and provide the parsed message * + * @typedef SIWEMessage * @param {boolean} isSIWEMessage - Does the intercepted message conform to the SIWE specification? * @param {ParsedMessage} parsedMessage - The data parsed out of the message */ diff --git a/packages/controller-utils/src/util.test.ts b/packages/controller-utils/src/util.test.ts index 21af2ff1ea9..db7ad0cf971 100644 --- a/packages/controller-utils/src/util.test.ts +++ b/packages/controller-utils/src/util.test.ts @@ -666,8 +666,6 @@ describe('util', () => { if (method === 'eth_getBlockByHash') { return cb(null, { id: params[0] }); } - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - throw new Error(`Unsupported method ${method}`); } } diff --git a/packages/controller-utils/src/util.ts b/packages/controller-utils/src/util.ts index 52bbe9e994d..65164aa1756 100644 --- a/packages/controller-utils/src/util.ts +++ b/packages/controller-utils/src/util.ts @@ -69,8 +69,6 @@ export function isSafeChainId(chainId: Hex): boolean { * @param inputBn - BN|BigNumber instance to convert to a hex string. * @returns A '0x'-prefixed hex string. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export function BNToHex(inputBn: BN | BigNumber) { return add0x(inputBn.toString(16)); } @@ -155,8 +153,6 @@ export function getBuyURL( ): string | undefined { switch (networkCode) { case '1': - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - return `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH`; case '5': return 'https://goerli-faucet.slock.it/'; @@ -299,8 +295,6 @@ function toChecksumHexAddressUnmemoized(address: string): string; * and is only present for backward compatibility. It may be removed in a future * major version. Please pass a string to `toChecksumHexAddress` instead. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - function toChecksumHexAddressUnmemoized(address: T): T; // Tools only see JSDocs for overloads and ignore them for the implementation. @@ -620,8 +614,6 @@ export function isPlainObject(value: unknown): value is PlainObject { * * @template T - The non-empty array member type. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export type NonEmptyArray = [T, ...T[]]; /** @@ -631,8 +623,6 @@ export type NonEmptyArray = [T, ...T[]]; * @param value - The value to check. * @returns Whether the value is a non-empty array. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export function isNonEmptyArray(value: T[]): value is NonEmptyArray { return Array.isArray(value) && value.length > 0; } diff --git a/packages/ens-controller/src/EnsController.test.ts b/packages/ens-controller/src/EnsController.test.ts index c5f3724d274..1a28a326733 100644 --- a/packages/ens-controller/src/EnsController.test.ts +++ b/packages/ens-controller/src/EnsController.test.ts @@ -49,8 +49,6 @@ jest.mock('@ethersproject/providers', () => { const originalModule = jest.requireActual('@ethersproject/providers'); return { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - __esModule: true, ...originalModule, }; diff --git a/packages/ens-controller/src/EnsController.ts b/packages/ens-controller/src/EnsController.ts index 8bdb429d465..4d7007ca8eb 100644 --- a/packages/ens-controller/src/EnsController.ts +++ b/packages/ens-controller/src/EnsController.ts @@ -50,11 +50,9 @@ export const DEFAULT_ENS_NETWORK_MAP: Record = { * * ENS entry representation * - * chainId - Id of the associated chain - * - * ensName - The ENS name - * - * address - Hex address with the ENS name, or null + * @property chainId - Id of the associated chain + * @property ensName - The ENS name + * @property address - Hex address with the ENS name, or null */ export type EnsEntry = { chainId: Hex; @@ -267,8 +265,6 @@ export class EnsController extends BaseController< (address && !isValidHexAddress(address)) ) { throw new Error( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `Invalid ENS entry: { chainId:${chainId}, ensName:${ensName}, address:${address}}`, ); } diff --git a/packages/gas-fee-controller/src/GasFeeController.test.ts b/packages/gas-fee-controller/src/GasFeeController.test.ts index 327fdb940dd..e1c2290e0fd 100644 --- a/packages/gas-fee-controller/src/GasFeeController.test.ts +++ b/packages/gas-fee-controller/src/GasFeeController.test.ts @@ -1099,14 +1099,10 @@ describe('GasFeeController', () => { isEIP1559Compatible: true, isLegacyGasAPICompatible: false, fetchGasEstimates, - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - fetchGasEstimatesUrl: `https://some-eip-1559-endpoint/${convertHexToDecimal( ChainId.sepolia, )}`, fetchLegacyGasPriceEstimates, - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - fetchLegacyGasPriceEstimatesUrl: `https://some-legacy-endpoint/${convertHexToDecimal( ChainId.sepolia, )}`, @@ -1210,8 +1206,6 @@ describe('GasFeeController', () => { expect(mockedDetermineGasFeeCalculations).toHaveBeenCalledWith( expect.objectContaining({ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - fetchGasEstimatesUrl: `http://eip-1559.endpoint/${convertHexToDecimal( ChainId.sepolia, )}`, @@ -1258,8 +1252,6 @@ describe('GasFeeController', () => { expect(mockedDetermineGasFeeCalculations).toHaveBeenNthCalledWith( 1, expect.objectContaining({ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - fetchGasEstimatesUrl: `https://some-eip-1559-endpoint/${convertHexToDecimal( ChainId['linea-sepolia'], )}`, @@ -1271,8 +1263,6 @@ describe('GasFeeController', () => { expect(mockedDetermineGasFeeCalculations).toHaveBeenNthCalledWith( 2, expect.objectContaining({ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - fetchGasEstimatesUrl: `https://some-eip-1559-endpoint/${convertHexToDecimal( ChainId['linea-sepolia'], )}`, @@ -1290,8 +1280,6 @@ describe('GasFeeController', () => { await clock.tickAsync(pollingInterval); expect(mockedDetermineGasFeeCalculations).toHaveBeenCalledWith( expect.objectContaining({ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - fetchGasEstimatesUrl: `https://some-eip-1559-endpoint/${convertHexToDecimal( ChainId.sepolia, )}`, diff --git a/packages/gas-fee-controller/src/GasFeeController.ts b/packages/gas-fee-controller/src/GasFeeController.ts index 508b68c4efd..e46361d0d55 100644 --- a/packages/gas-fee-controller/src/GasFeeController.ts +++ b/packages/gas-fee-controller/src/GasFeeController.ts @@ -33,8 +33,6 @@ import { export const LEGACY_GAS_PRICES_API_URL = `https://api.metaswap.codefi.network/gasPrices`; -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export type unknownString = 'unknown'; // Fee Market describes the way gas is set after the london hardfork, and was @@ -98,11 +96,9 @@ export type EthGasPriceEstimate = { * These estimates include low, medium and high all as strings representing gwei in * decimal format. * - * high - gasPrice, in decimal gwei string format, suggested for fast inclusion - * - * medium - gasPrice, in decimal gwei string format, suggested for avg inclusion - * - * low - gasPrice, in decimal gwei string format, suggested for slow inclusion + * @property high - gasPrice, in decimal gwei string format, suggested for fast inclusion + * @property medium - gasPrice, in decimal gwei string format, suggested for avg inclusion + * @property low - gasPrice, in decimal gwei string format, suggested for slow inclusion */ export type LegacyGasPriceEstimate = { high: string; @@ -115,13 +111,10 @@ export type LegacyGasPriceEstimate = { * * Data necessary to provide an estimate of a gas fee with a specific tip * - * minWaitTimeEstimate - The fastest the transaction will take, in milliseconds - * - * maxWaitTimeEstimate - The slowest the transaction will take, in milliseconds - * - * suggestedMaxPriorityFeePerGas - A suggested "tip", a GWEI hex number - * - * suggestedMaxFeePerGas - A suggested max fee, the most a user will pay. a GWEI hex number + * @property minWaitTimeEstimate - The fastest the transaction will take, in milliseconds + * @property maxWaitTimeEstimate - The slowest the transaction will take, in milliseconds + * @property suggestedMaxPriorityFeePerGas - A suggested "tip", a GWEI hex number + * @property suggestedMaxFeePerGas - A suggested max fee, the most a user will pay. a GWEI hex number */ export type Eip1559GasFee = { minWaitTimeEstimate: number; // a time duration in milliseconds @@ -135,14 +128,10 @@ export type Eip1559GasFee = { * * Data necessary to provide multiple GasFee estimates, and supporting information, to the user * - * low - A GasFee for a minimum necessary combination of tip and maxFee - * - * medium - A GasFee for a recommended combination of tip and maxFee - * - * high - A GasFee for a high combination of tip and maxFee - * - * estimatedBaseFee - An estimate of what the base fee will be for the pending/next block. A GWEI dec number - * + * @property low - A GasFee for a minimum necessary combination of tip and maxFee + * @property medium - A GasFee for a recommended combination of tip and maxFee + * @property high - A GasFee for a high combination of tip and maxFee + * @property estimatedBaseFee - An estimate of what the base fee will be for the pending/next block. A GWEI dec number * @property networkCongestion - A normalized number that can be used to gauge the congestion * level of the network, with 0 meaning not congested and 1 meaning extremely congested */ @@ -241,9 +230,8 @@ export type FetchGasFeeEstimateOptions = { * * Gas Fee controller state * - * gasFeeEstimates - Gas fee estimate data based on new EIP-1559 properties - * - * estimatedGasFeeTimeBounds - Estimates representing the minimum and maximum + * @property gasFeeEstimates - Gas fee estimate data based on new EIP-1559 properties + * @property estimatedGasFeeTimeBounds - Estimates representing the minimum and maximum */ export type SingleChainGasFeeState = | GasFeeStateEthGasPrice @@ -313,8 +301,6 @@ export class GasFeeController extends StaticIntervalPollingController ({ }); /** - * OriginalRequest + * @type OriginalRequest * * Represents the original request object for adding a message. * - * origin? - Is it is specified, represents the origin + * @property origin? - Is it is specified, represents the origin */ export type OriginalRequest = { id?: number; @@ -50,19 +50,15 @@ export type OriginalRequest = { }; /** - * AbstractMessage + * @type AbstractMessage * * Represents and contains data about a signing type signature request. * - * id - An id to track and identify the message object - * - * type - The json-prc signing method for which a signature request has been made. + * @property id - An id to track and identify the message object + * @property type - The json-prc signing method for which a signature request has been made. * A 'Message' which always has a signing type - * - * rawSig - Raw data of the signature request - * - * securityProviderResponse - Response from a security provider, whether it is malicious or not - * + * @property rawSig - Raw data of the signature request + * @property securityProviderResponse - Response from a security provider, whether it is malicious or not * @property metadata - Additional data for the message, for example external identifiers */ export type AbstractMessage = { @@ -78,17 +74,14 @@ export type AbstractMessage = { }; /** - * AbstractMessageParams + * @type AbstractMessageParams * * Represents the parameters to pass to the signing method once the signature request is approved. + * @property from - Address from which the message is processed + * @property origin? - Added for request origin identification + * @property requestId? - Original request id + * @property deferSetAsSigned? - Whether to defer setting the message as signed immediately after the keyring is told to sign it * - * from - Address from which the message is processed - * - * origin? - Added for request origin identification - * - * requestId? - Original request id - * - * deferSetAsSigned? - Whether to defer setting the message as signed immediately after the keyring is told to sign it */ export type AbstractMessageParams = { from: string; @@ -98,29 +91,27 @@ export type AbstractMessageParams = { }; /** - * MessageParamsMetamask + * @type MessageParamsMetamask * * Represents the parameters to pass to the signing method once the signature request is approved * plus data added by MetaMask. * - * metamaskId - Added for tracking and identification within MetaMask + * @property metamaskId - Added for tracking and identification within MetaMask + * @property from - Address from which the message is processed + * @property origin? - Added for request origin identification * - * from - Address from which the message is processed - * - * origin? - Added for request origin identification */ export type AbstractMessageParamsMetamask = AbstractMessageParams & { metamaskId?: string; }; /** - * MessageManagerState + * @type MessageManagerState * * Message Manager state * - * unapprovedMessages - A collection of all Messages in the 'unapproved' state - * - * unapprovedMessagesCount - The count of all Messages in this.unapprovedMessages + * @property unapprovedMessages - A collection of all Messages in the 'unapproved' state + * @property unapprovedMessagesCount - The count of all Messages in this.unapprovedMessages */ export type MessageManagerState = { unapprovedMessages: Record; @@ -143,15 +134,11 @@ export type SecurityProviderRequest = ( /** * AbstractMessageManager constructor options. * - * additionalFinishStatuses - Optional list of statuses that are accepted to emit a finished event. - * - * messenger - Controller messaging system. - * - * name - The name of the manager. - * - * securityProviderRequest - A function for verifying a message, whether it is malicious or not. - * - * state - Initial state to set on this controller. + * @property additionalFinishStatuses - Optional list of statuses that are accepted to emit a finished event. + * @property messenger - Controller messaging system. + * @property name - The name of the manager. + * @property securityProviderRequest - A function for verifying a message, whether it is malicious or not. + * @property state - Initial state to set on this controller. */ export type AbstractMessageManagerOptions< Name extends string, diff --git a/packages/message-manager/src/DecryptMessageManager.ts b/packages/message-manager/src/DecryptMessageManager.ts index c3b239b95e2..81f6c66934e 100644 --- a/packages/message-manager/src/DecryptMessageManager.ts +++ b/packages/message-manager/src/DecryptMessageManager.ts @@ -55,16 +55,14 @@ type DecryptMessageManagerOptions = { }; /** - * DecryptMessage + * @type DecryptMessage * * Represents and contains data about a 'eth_decrypt' type signature request. * These are created when a signature for an eth_decrypt call is requested. * - * id - An id to track and identify the message object - * - * messageParams - The parameters to pass to the eth_decrypt method once the request is approved - * - * type - The json-prc signing method for which a signature request has been made. + * @property id - An id to track and identify the message object + * @property messageParams - The parameters to pass to the eth_decrypt method once the request is approved + * @property type - The json-prc signing method for which a signature request has been made. * A 'DecryptMessage' which always has a 'eth_decrypt' type */ export type DecryptMessage = AbstractMessage & { @@ -72,29 +70,25 @@ export type DecryptMessage = AbstractMessage & { }; /** - * DecryptMessageParams + * @type DecryptMessageParams * * Represents the parameters to pass to the eth_decrypt method once the request is approved. - * - * data - A hex string conversion of the raw buffer data of the signature request + * @property data - A hex string conversion of the raw buffer data of the signature request */ export type DecryptMessageParams = AbstractMessageParams & { data: string; }; /** - * DecryptMessageParamsMetamask + * @type DecryptMessageParamsMetamask * * Represents the parameters to pass to the eth_decrypt method once the request is approved * plus data added by MetaMask. * - * metamaskId - Added for tracking and identification within MetaMask - * - * data - A hex string conversion of the raw buffer data of the signature request - * - * from - Address to sign this message from - * - * origin? - Added for request origin identification + * @property metamaskId - Added for tracking and identification within MetaMask + * @property data - A hex string conversion of the raw buffer data of the signature request + * @property from - Address to sign this message from + * @property origin? - Added for request origin identification */ // This interface was created before this ESLint rule was added. // Convert to a `type` in a future major version. diff --git a/packages/message-manager/src/EncryptionPublicKeyManager.ts b/packages/message-manager/src/EncryptionPublicKeyManager.ts index d70d8d5696b..9b3fec821dc 100644 --- a/packages/message-manager/src/EncryptionPublicKeyManager.ts +++ b/packages/message-manager/src/EncryptionPublicKeyManager.ts @@ -58,48 +58,40 @@ type EncryptionPublicKeyManagerOptions = { }; /** - * EncryptionPublicKey + * @type EncryptionPublicKey * * Represents and contains data about a 'eth_getEncryptionPublicKey' type request. * These are created when an encryption public key is requested. * - * id - An id to track and identify the message object - * - * messageParams - The parameters to pass to the eth_getEncryptionPublicKey method once the request is approved - * - * type - The json-prc method for which an encryption public key request has been made. + * @property id - An id to track and identify the message object + * @property messageParams - The parameters to pass to the eth_getEncryptionPublicKey method once the request is approved + * @property type - The json-prc method for which an encryption public key request has been made. * A 'Message' which always has a 'eth_getEncryptionPublicKey' type - * - * rawSig - Encryption public key + * @property rawSig - Encryption public key */ export type EncryptionPublicKey = AbstractMessage & { messageParams: EncryptionPublicKeyParams; }; /** - * EncryptionPublicKeyParams + * @type EncryptionPublicKeyParams * * Represents the parameters to pass to the method once the request is approved. - * - * from - Address from which to extract the encryption public key - * - * origin? - Added for request origin identification + * @property from - Address from which to extract the encryption public key + * @property origin? - Added for request origin identification */ export type EncryptionPublicKeyParams = AbstractMessageParams; /** - * MessageParamsMetamask + * @type MessageParamsMetamask * * Represents the parameters to pass to the eth_getEncryptionPublicKey method once the request is approved * plus data added by MetaMask. * - * metamaskId - Added for tracking and identification within MetaMask - * - * data - Encryption public key - * - * from - Address from which to extract the encryption public key - * - * origin? - Added for request origin identification + * @property metamaskId - Added for tracking and identification within MetaMask + * @property data - Encryption public key + * @property from - Address from which to extract the encryption public key + * @property origin? - Added for request origin identification */ export type EncryptionPublicKeyParamsMetamask = AbstractMessageParamsMetamask & { diff --git a/packages/name-controller/src/NameController.ts b/packages/name-controller/src/NameController.ts index a1c8effd3eb..36d55321efe 100644 --- a/packages/name-controller/src/NameController.ts +++ b/packages/name-controller/src/NameController.ts @@ -22,12 +22,8 @@ export const PROPOSED_NAME_EXPIRE_DURATION = 60 * 60 * 24; // 24 hours */ export enum NameOrigin { // Originated from an account identity. - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - ACCOUNT_IDENTITY = 'account-identity', // Originated from an address book entry. - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - ADDRESS_BOOK = 'address-book', // Originated from the API (NameController.setName). This is the default. API = 'api', diff --git a/packages/name-controller/src/providers/etherscan.ts b/packages/name-controller/src/providers/etherscan.ts index 503b01ecc67..9d26e5db03b 100644 --- a/packages/name-controller/src/providers/etherscan.ts +++ b/packages/name-controller/src/providers/etherscan.ts @@ -23,41 +23,17 @@ type EtherscanGetSourceCodeResponse = { message: string; result: [ { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - SourceCode: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - ABI: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - ContractName: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - CompilerVersion: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - OptimizationUsed: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - Runs: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - ConstructorArguments: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - Library: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - LicenseType: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - Proxy: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - Implementation: string; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - SwarmSource: string; }, ]; @@ -192,8 +168,6 @@ export class EtherscanNameProvider implements NameProvider { Object.keys(params).forEach((key, index) => { const value = params[key]; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - url += `${index === 0 ? '?' : '&'}${key}=${value}`; }); diff --git a/packages/name-controller/src/types.ts b/packages/name-controller/src/types.ts index 6bdb5a84494..c1da882409d 100644 --- a/packages/name-controller/src/types.ts +++ b/packages/name-controller/src/types.ts @@ -1,8 +1,6 @@ /** The name types supported by the NameController. */ export enum NameType { /** The address of an Ethereum account. */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - ETHEREUM_ADDRESS = 'ethereumAddress', } diff --git a/packages/name-controller/src/util.ts b/packages/name-controller/src/util.ts index eb4c9265f84..dac27892b6d 100644 --- a/packages/name-controller/src/util.ts +++ b/packages/name-controller/src/util.ts @@ -5,8 +5,6 @@ * @param query - GraphQL query. * @param variables - GraphQL variables. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export async function graphQL( url: string, query: string, diff --git a/packages/permission-log-controller/src/PermissionLogController.ts b/packages/permission-log-controller/src/PermissionLogController.ts index 0cb119339ed..846a7073fbe 100644 --- a/packages/permission-log-controller/src/PermissionLogController.ts +++ b/packages/permission-log-controller/src/PermissionLogController.ts @@ -57,11 +57,10 @@ export type PermissionHistory = Record; /** * - *Permission log controller state + * Permission log controller state * - *permissionHistory - permission history - * - * permissionActivityLog - permission activity logs + * @property permissionHistory - permission history + * @property permissionActivityLog - permission activity logs */ export type PermissionLogControllerState = { permissionHistory: PermissionHistory; @@ -153,8 +152,6 @@ export class PermissionLogController extends BaseController< return; } const newEntries = { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - eth_accounts: { accounts: this.#getAccountToTimeMap(accounts, Date.now()), }, @@ -321,8 +318,6 @@ export class PermissionLogController extends BaseController< // a set of accounts if the RPC method is "eth_requestAccounts". const accounts = result as string[]; newEntries = { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - eth_accounts: { accounts: this.#getAccountToTimeMap(accounts, time), lastApproved: time, diff --git a/packages/permission-log-controller/src/enums.ts b/packages/permission-log-controller/src/enums.ts index 36d323b95a1..598852aedc3 100644 --- a/packages/permission-log-controller/src/enums.ts +++ b/packages/permission-log-controller/src/enums.ts @@ -9,14 +9,8 @@ export const LOG_IGNORE_METHODS = [ 'wallet_watchAsset', ]; -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export enum LOG_METHOD_TYPES { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - restricted = 'restricted', - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - internal = 'internal', } diff --git a/packages/permission-log-controller/tests/helpers.ts b/packages/permission-log-controller/tests/helpers.ts index 4857f4ed2a3..eab0c88831e 100644 --- a/packages/permission-log-controller/tests/helpers.ts +++ b/packages/permission-log-controller/tests/helpers.ts @@ -23,14 +23,8 @@ const SUBJECTS = { }; const PERM_NAMES = Object.freeze({ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - eth_accounts: 'eth_accounts', - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - test_method: 'test_method', - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - does_not_exist: 'does_not_exist', }); @@ -59,8 +53,6 @@ const CAVEATS = { * @param accounts - The accounts for the caveat * @returns An eth_accounts restrictReturnedAccounts caveats */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - eth_accounts: (accounts: string[]) => { return [ { @@ -85,11 +77,7 @@ const PERMS = { * * @returns A permissions request object with eth_accounts */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - eth_accounts: () => { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - return { eth_accounts: {} }; }, @@ -98,11 +86,7 @@ const PERMS = { * * @returns A permissions request object with test_method */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - test_method: () => { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - return { test_method: {} }; }, @@ -111,11 +95,7 @@ const PERMS = { * * @returns A permissions request object with does_not_exist */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - does_not_exist: () => { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - return { does_not_exist: {} }; }, }, @@ -132,8 +112,6 @@ const PERMS = { * @param accounts - The accounts for the eth_accounts permission caveat * @returns A granted permissions object with eth_accounts and its caveat */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - eth_accounts: (accounts: string[]) => { return { parentCapability: PERM_NAMES.eth_accounts, @@ -146,8 +124,6 @@ const PERMS = { * * @returns A granted permissions object with test_method */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - test_method: () => { return { parentCapability: PERM_NAMES.test_method, @@ -193,8 +169,6 @@ export const getters = deepFreeze({ * @param origin - The origin of the request * @returns An RPC request object */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - eth_accounts: (origin: string) => { return { ...JsonRpcRequestStruct.TYPE, @@ -211,8 +185,6 @@ export const getters = deepFreeze({ * @param param - The request param * @returns An RPC request object */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - test_method: (origin: string, param = false) => { return { ...JsonRpcRequestStruct.TYPE, @@ -228,8 +200,6 @@ export const getters = deepFreeze({ * @param origin - The origin of the request * @returns An RPC request object */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - eth_requestAccounts: (origin: string) => { return { ...JsonRpcRequestStruct.TYPE, @@ -284,8 +254,6 @@ export const getters = deepFreeze({ * @param args - Any other data for the request's subjectMetadata * @returns An RPC request object */ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - metamask_sendDomainMetadata: ( origin: string, name: string, diff --git a/packages/phishing-controller/src/PhishingController.ts b/packages/phishing-controller/src/PhishingController.ts index 3f8a9178951..172d6ea4b42 100644 --- a/packages/phishing-controller/src/PhishingController.ts +++ b/packages/phishing-controller/src/PhishingController.ts @@ -96,14 +96,10 @@ export type ListTypes = * Configuration response from the eth-phishing-detect package * consisting of approved and unapproved website origins * - * blacklist - List of unapproved origins - * - * fuzzylist - List of fuzzy-matched unapproved origins - * - * tolerance - Fuzzy match tolerance level - * - * version - Version number of this configuration - * + * @property blacklist - List of unapproved origins + * @property fuzzylist - List of fuzzy-matched unapproved origins + * @property tolerance - Fuzzy match tolerance level + * @property version - Version number of this configuration * @property whitelist - List of approved origins */ export type EthPhishingResponse = { @@ -119,11 +115,9 @@ export type EthPhishingResponse = { * * Response for blocklist update requests * - * recentlyAdded - List of c2 domains recently added to the blocklist - * - * recentlyRemoved - List of c2 domains recently removed from the blocklist - * - * lastFetchedAt - Timestamp of the last fetch request + * @property recentlyAdded - List of c2 domains recently added to the blocklist + * @property recentlyRemoved - List of c2 domains recently removed from the blocklist + * @property lastFetchedAt - Timestamp of the last fetch request */ export type C2DomainBlocklistResponse = { recentlyAdded: string[]; @@ -157,14 +151,10 @@ export type PhishingStalelist = { * * type defining the persisted list state. This is the persisted state that is updated frequently with `this.maybeUpdateState()`. * - * allowlist - List of approved origins (legacy naming "whitelist") - * - * blocklist - List of unapproved origins (legacy naming "blacklist") - * - * blocklistPaths - Trie of unapproved origins with paths (hostname + path, no query params). - * - * c2DomainBlocklist - List of hashed hostnames that C2 requests are blocked against. - * + * @property allowlist - List of approved origins (legacy naming "whitelist") + * @property blocklist - List of unapproved origins (legacy naming "blacklist") + * @property blocklistPaths - Trie of unapproved origins with paths (hostname + path, no query params). + * @property c2DomainBlocklist - List of hashed hostnames that C2 requests are blocked against. * @property fuzzylist - List of fuzzy-matched unapproved origins * @property tolerance - Fuzzy match tolerance level * @property lastUpdated - Timestamp of last update. @@ -188,13 +178,10 @@ export type PhishingListState = { * * type defining the expected type of the diffs in hotlist.json file. * - * url - Url of the diff entry. - * - * timestamp - Timestamp at which the diff was identified. - * - * targetList - The list name where the diff was identified. - * - * isRemoval - Was the diff identified a removal type. + * @property url - Url of the diff entry. + * @property timestamp - Timestamp at which the diff was identified. + * @property targetList - The list name where the diff was identified. + * @property isRemoval - Was the diff identified a removal type. */ export type HotlistDiff = { url: string; @@ -212,13 +199,10 @@ export type DataResultWrapper = { * * Type defining expected hotlist.json file. * - * url - Url of the diff entry. - * - * timestamp - Timestamp at which the diff was identified. - * - * targetList - The list name where the diff was identified. - * - * isRemoval - Was the diff identified a removal type. + * @property url - Url of the diff entry. + * @property timestamp - Timestamp at which the diff was identified. + * @property targetList - The list name where the diff was identified. + * @property isRemoval - Was the diff identified a removal type. */ export type Hotlist = HotlistDiff[]; diff --git a/packages/polling-controller/src/AbstractPollingController.ts b/packages/polling-controller/src/AbstractPollingController.ts index f5b37946ef3..3957ccb3f97 100644 --- a/packages/polling-controller/src/AbstractPollingController.ts +++ b/packages/polling-controller/src/AbstractPollingController.ts @@ -17,8 +17,6 @@ export const getKey = (input: PollingInput): PollingTokenSetId => * @param Base - The base class to mix onto. * @returns The composed class. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - export function AbstractPollingControllerBaseMixin< TBase extends Constructor, PollingInput extends Json, diff --git a/packages/polling-controller/src/BlockTrackerPollingController.ts b/packages/polling-controller/src/BlockTrackerPollingController.ts index 86594523a48..f58ead95a0e 100644 --- a/packages/polling-controller/src/BlockTrackerPollingController.ts +++ b/packages/polling-controller/src/BlockTrackerPollingController.ts @@ -26,8 +26,6 @@ export type BlockTrackerPollingInput = { * @param Base - The base class to mix onto. * @returns The composed class. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - function BlockTrackerPollingControllerMixin< TBase extends Constructor, PollingInput extends BlockTrackerPollingInput, @@ -58,8 +56,6 @@ function BlockTrackerPollingControllerMixin< this.#activeListeners[key] = updateOnNewBlock; } else { throw new Error( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `Unable to retrieve blockTracker for networkClientId ${input.networkClientId}`, ); } diff --git a/packages/polling-controller/src/StaticIntervalPollingController.ts b/packages/polling-controller/src/StaticIntervalPollingController.ts index 22b682f2f0d..ec0d9074ab2 100644 --- a/packages/polling-controller/src/StaticIntervalPollingController.ts +++ b/packages/polling-controller/src/StaticIntervalPollingController.ts @@ -18,8 +18,6 @@ import type { * @param Base - The base class to mix onto. * @returns The composed class. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - function StaticIntervalPollingControllerMixin< TBase extends Constructor, PollingInput extends Json, diff --git a/packages/rate-limit-controller/src/RateLimitController.ts b/packages/rate-limit-controller/src/RateLimitController.ts index d927c2c12be..a693239c666 100644 --- a/packages/rate-limit-controller/src/RateLimitController.ts +++ b/packages/rate-limit-controller/src/RateLimitController.ts @@ -10,11 +10,9 @@ import { getKnownPropertyNames } from '@metamask/utils'; /** * A rate-limited API endpoint. * - * method - The method that is rate-limited. - * - * rateLimitTimeout - The time window in which the rate limit is applied (in ms). - * - * rateLimitCount - The amount of calls an origin can make in the rate limit time window. + * @property method - The method that is rate-limited. + * @property rateLimitTimeout - The time window in which the rate limit is applied (in ms). + * @property rateLimitCount - The amount of calls an origin can make in the rate limit time window. */ export type RateLimitedApi = { method: ActionConstraint['handler']; @@ -219,8 +217,6 @@ export class RateLimitController< Object.assign(state, { requests: { ...(state.requests as RateLimitedRequests), - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - [api]: { [origin]: previous + 1 }, }, }); diff --git a/packages/signature-controller/src/utils/validation.test.ts b/packages/signature-controller/src/utils/validation.test.ts index 1d313b6634a..effa714ab81 100644 --- a/packages/signature-controller/src/utils/validation.test.ts +++ b/packages/signature-controller/src/utils/validation.test.ts @@ -234,8 +234,6 @@ describe('Validation Utils', () => { version, }), ).toThrow( - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `Provided chainId "${convertHexToDecimal( CHAIN_ID_MOCK, // TODO: Either fix this lint violation or explain why it's necessary to ignore. diff --git a/packages/user-operation-controller/src/UserOperationController.test.ts b/packages/user-operation-controller/src/UserOperationController.test.ts index 743a6c9e911..6f3c0e9e900 100644 --- a/packages/user-operation-controller/src/UserOperationController.test.ts +++ b/packages/user-operation-controller/src/UserOperationController.test.ts @@ -241,8 +241,6 @@ describe('UserOperationController', () => { return approvalControllerAddRequestMock(); } - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - throw new Error(`Unexpected mock messenger action: ${action}`); }, ); diff --git a/packages/user-operation-controller/src/UserOperationController.ts b/packages/user-operation-controller/src/UserOperationController.ts index adad6364ced..af6c00fbd09 100644 --- a/packages/user-operation-controller/src/UserOperationController.ts +++ b/packages/user-operation-controller/src/UserOperationController.ts @@ -82,22 +82,16 @@ type Events = { }; export type UserOperationControllerEventEmitter = EventEmitter & { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - on( eventName: T, listener: (...args: Events[T]) => void, ): UserOperationControllerEventEmitter; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - once( eventName: T, listener: (...args: Events[T]) => void, ): UserOperationControllerEventEmitter; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - emit(eventName: T, ...args: Events[T]): boolean; }; @@ -711,8 +705,6 @@ export class UserOperationController extends BaseController< (metadata) => { log('In listener...'); this.hub.emit('user-operation-confirmed', metadata); - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - this.hub.emit(`${metadata.id}:confirmed`, metadata); }, ); @@ -721,8 +713,6 @@ export class UserOperationController extends BaseController< 'user-operation-failed', (metadata, error) => { this.hub.emit('user-operation-failed', metadata, error); - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - this.hub.emit(`${metadata.id}:failed`, metadata, error); }, ); diff --git a/packages/user-operation-controller/src/helpers/Bundler.ts b/packages/user-operation-controller/src/helpers/Bundler.ts index 9d98e3361bd..7e66581aeed 100644 --- a/packages/user-operation-controller/src/helpers/Bundler.ts +++ b/packages/user-operation-controller/src/helpers/Bundler.ts @@ -98,8 +98,6 @@ export class Bundler { return hash; } - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - async #query(method: string, params: unknown[]): Promise { const request = { method: 'POST', diff --git a/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts b/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts index cda8beac582..379c616bd59 100644 --- a/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts +++ b/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts @@ -26,22 +26,16 @@ type Events = { }; export type PendingUserOperationTrackerEventEmitter = EventEmitter & { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - on( eventName: T, listener: (...args: Events[T]) => void, ): PendingUserOperationTrackerEventEmitter; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - once( eventName: T, listener: (...args: Events[T]) => void, ): PendingUserOperationTrackerEventEmitter; - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - emit(eventName: T, ...args: Events[T]): boolean; }; diff --git a/packages/user-operation-controller/src/utils/validation.test.ts b/packages/user-operation-controller/src/utils/validation.test.ts index 93b59dfdd6c..a3c58262e27 100644 --- a/packages/user-operation-controller/src/utils/validation.test.ts +++ b/packages/user-operation-controller/src/utils/validation.test.ts @@ -71,8 +71,6 @@ const SIGN_USER_OPERATION_RESPONSE_MOCK: SignUserOperationResponse = { * @param value - The value to set. * @returns The copied object with the property path set to the given value. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - function setPropertyPath(object: T, pathString: string, value: unknown): T { const copy = cloneDeep(object); const path = pathString.split('.'); @@ -99,8 +97,6 @@ function setPropertyPath(object: T, pathString: string, value: unknown): T { * @param expectedInternalError - The specific validation error. * @param rootPropertyName - The name of the root input. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - function expectValidationError( validateFunction: (request: T) => void, input: T, diff --git a/packages/user-operation-controller/src/utils/validation.ts b/packages/user-operation-controller/src/utils/validation.ts index b39f443a958..3e06d4b500f 100644 --- a/packages/user-operation-controller/src/utils/validation.ts +++ b/packages/user-operation-controller/src/utils/validation.ts @@ -188,8 +188,6 @@ export function validateSignUserOperationResponse( * @param struct - The struct to validate against. * @param message - The message to throw if validation fails. */ -// TODO: Either fix this lint violation or explain why it's necessary to ignore. - function validate(data: unknown, struct: Struct, message: string) { try { assert(data, struct, message); diff --git a/scripts/create-package/cli.test.ts b/scripts/create-package/cli.test.ts index 19fe760cdcc..612bedaf942 100644 --- a/scripts/create-package/cli.test.ts +++ b/scripts/create-package/cli.test.ts @@ -25,8 +25,6 @@ function getMockArgv(...args: string[]) { */ function getParsedArgv(name: string, description: string) { return { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - _: [], $0: 'create-package', name: `@metamask/${name}`, diff --git a/scripts/create-package/commands.test.ts b/scripts/create-package/commands.test.ts index 980bd6be09f..cb6889d834c 100644 --- a/scripts/create-package/commands.test.ts +++ b/scripts/create-package/commands.test.ts @@ -26,8 +26,6 @@ describe('create-package/commands', () => { }); const args: Arguments = { - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - _: [], $0: 'create-package', name: '@metamask/new-package', diff --git a/tests/fake-provider.ts b/tests/fake-provider.ts index 0077eaa0efa..7417d5871f3 100644 --- a/tests/fake-provider.ts +++ b/tests/fake-provider.ts @@ -43,18 +43,12 @@ export type FakeProviderResponse = { result: any } | { error: string }; * throw an error, and if it returns a promise, that promise can either be * resolved with a response object or reject with an error. * - * request - Looks for a request matching these specifications. - * - * request.method - The RPC method to which this stub will be matched. - * - * request.params - The params to which this stub will be matched. - * - * response - Instructs `request` to return a promise that resolves - * with a response object. - * - * response.result - Specifies a successful response, with this as the + * @property request - Looks for a request matching these specifications. + * @property request.method - The RPC method to which this stub will be matched. + * @property request.params - The params to which this stub will be matched. + * @property response - Instructs `request` to return a promise that resolves + * @property response.result - Specifies a successful response, with this as the * `result`. - * * @property response.error - Specifies an error response, with this as the * `error`. * @property error - Instructs `request` to return a promise that rejects with @@ -96,7 +90,7 @@ export type FakeProviderStub = { /** * The set of options that the FakeProvider constructor takes. * - * stubs - A set of objects that allow specifying the behavior + * @property stubs - A set of objects that allow specifying the behavior * of specific invocations of `request` matching a `method`. */ type FakeProviderEngineOptions = { diff --git a/tests/mock-network.ts b/tests/mock-network.ts index 65f6944500c..2b22eeba945 100644 --- a/tests/mock-network.ts +++ b/tests/mock-network.ts @@ -8,17 +8,12 @@ import { NetworkClientType } from '../packages/network-controller/src/types'; * An object which instructs the MockedNetwork class which JSON-RPC request * should be mocked and how that request should respond. * - * request - The JSON-RPC request that should be mocked. - * - * request.method - The JSON-RPC method. - * - * request.params - The JSON-RPC params (optional). - * - * response - The JSON-RPC response that the request should return. - * - * response.result - Specifies the `result` field of the JSON-RPC + * @property request - The JSON-RPC request that should be mocked. + * @property request.method - The JSON-RPC method. + * @property request.params - The JSON-RPC params (optional). + * @property response - The JSON-RPC response that the request should return. + * @property response.result - Specifies the `result` field of the JSON-RPC * response. - * * @property response.error - Specifies the `error` field of the JSON-RPC * response. * @property error - The error that should be raised upon making the request. @@ -115,9 +110,7 @@ class MockedNetwork { this.#requestMocks = mocks; const rpcUrl = networkClientConfiguration.type === 'infura' - ? // TODO: Either fix this lint violation or explain why it's necessary to ignore. - - `https://${networkClientConfiguration.network}.infura.io` + ? `https://${networkClientConfiguration.network}.infura.io` : networkClientConfiguration.rpcUrl; this.#nockScope = nock(rpcUrl); this.#rpcUrl = rpcUrl; diff --git a/tests/setupAfterEnv/matchers.ts b/tests/setupAfterEnv/matchers.ts index b73551d64fc..e51a630c460 100644 --- a/tests/setupAfterEnv/matchers.ts +++ b/tests/setupAfterEnv/matchers.ts @@ -51,8 +51,6 @@ expect.extend({ if (rejectionValue !== UNRESOLVED) { return { message: () => - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - `Expected promise to be fulfilled, but it was rejected with ${rejectionValue}.`, pass: false, }; @@ -110,8 +108,6 @@ expect.extend({ : { message: () => { return `Expected promise to never resolve after ${TIME_TO_WAIT_UNTIL_UNRESOLVED}ms, but it ${ - // TODO: Either fix this lint violation or explain why it's necessary to ignore. - rejectionValue ? `was rejected with ${rejectionValue}` : `resolved with ${resolutionValue}` From d48c294fb4dc86ce015faf8b54a2075a32250b5a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 10 Nov 2025 14:36:02 -0330 Subject: [PATCH 3/6] Revert more JSDoc changes, remove extra lines and obsolete comments --- eslint-warning-thresholds.json | 15 ++++++++------ .../assets-controllers/src/NftController.ts | 2 -- .../src/NftDetectionController.test.ts | 2 -- .../src/TokenRatesController.ts | 2 +- .../assets-controllers/src/multicall.test.ts | 5 ----- .../src/ComposableController.ts | 2 -- packages/controller-utils/src/siwe.ts | 2 +- packages/ens-controller/src/EnsController.ts | 6 +++--- .../src/GasFeeController.test.ts | 1 - .../src/GasFeeController.ts | 13 ++++++------ .../src/createStreamMiddleware.ts | 2 -- .../src/LoggingController.test.ts | 2 -- .../src/LoggingController.ts | 2 +- ...chainMethodCallValidatorMiddleware.test.ts | 20 ------------------- .../src/NetworkController.ts | 2 -- .../tests/network-client/helpers.ts | 2 -- .../src/PermissionController.test.ts | 6 ------ .../src/SubjectMetadataController.ts | 4 ---- .../src/rpc-methods/revokePermissions.test.ts | 8 -------- .../src/PhishingController.ts | 14 ++++++------- .../src/RateLimitController.ts | 2 +- .../sample-gas-prices-service.test.ts | 2 -- .../sample-gas-prices-service.ts | 2 -- tests/fake-provider.ts | 1 + 24 files changed, 30 insertions(+), 89 deletions(-) diff --git a/eslint-warning-thresholds.json b/eslint-warning-thresholds.json index 698da877607..6d1b232dd25 100644 --- a/eslint-warning-thresholds.json +++ b/eslint-warning-thresholds.json @@ -64,7 +64,7 @@ "jest/no-conditional-in-test": 2 }, "packages/assets-controllers/src/TokenRatesController.ts": { - "jsdoc/check-tag-names": 10 + "jsdoc/check-tag-names": 11 }, "packages/assets-controllers/src/TokensController.test.ts": { "import-x/namespace": 1, @@ -99,7 +99,7 @@ }, "packages/controller-utils/src/siwe.ts": { "@typescript-eslint/no-unused-vars": 1, - "jsdoc/check-tag-names": 4 + "jsdoc/check-tag-names": 5 }, "packages/controller-utils/src/util.test.ts": { "import-x/no-named-as-default": 1, @@ -116,7 +116,7 @@ "@typescript-eslint/no-misused-promises": 1 }, "packages/ens-controller/src/EnsController.ts": { - "jsdoc/check-tag-names": 3 + "jsdoc/check-tag-names": 6 }, "packages/eth-block-tracker/src/PollingBlockTracker.test.ts": { "@typescript-eslint/unbound-method": 4 @@ -222,7 +222,7 @@ "import-x/namespace": 2 }, "packages/gas-fee-controller/src/GasFeeController.ts": { - "jsdoc/check-tag-names": 14 + "jsdoc/check-tag-names": 20 }, "packages/json-rpc-middleware-stream/src/index.test.ts": { "@typescript-eslint/prefer-promise-reject-errors": 1, @@ -242,6 +242,9 @@ "packages/logging-controller/src/LoggingController.test.ts": { "import-x/namespace": 1 }, + "packages/logging-controller/src/LoggingController.ts": { + "jsdoc/check-tag-names": 1 + }, "packages/message-manager/src/AbstractMessageManager.test.ts": { "jest/no-conditional-in-test": 7 }, @@ -289,7 +292,7 @@ "jsdoc/check-tag-names": 2 }, "packages/phishing-controller/src/PhishingController.ts": { - "jsdoc/check-tag-names": 25 + "jsdoc/check-tag-names": 32 }, "packages/phishing-controller/src/utils.test.ts": { "import-x/namespace": 5 @@ -298,7 +301,7 @@ "@typescript-eslint/no-unsafe-enum-comparison": 1 }, "packages/rate-limit-controller/src/RateLimitController.ts": { - "jsdoc/check-tag-names": 3 + "jsdoc/check-tag-names": 4 }, "packages/remote-feature-flag-controller/src/client-config-api-service/client-config-api-service.test.ts": { "promise/param-names": 1 diff --git a/packages/assets-controllers/src/NftController.ts b/packages/assets-controllers/src/NftController.ts index fc26e7945c7..15113baa394 100644 --- a/packages/assets-controllers/src/NftController.ts +++ b/packages/assets-controllers/src/NftController.ts @@ -525,8 +525,6 @@ export class NftController extends BaseController< } #getNftCollectionApi(): string { - // False negative. - return `${NFT_API_BASE_URL}/collections`; } diff --git a/packages/assets-controllers/src/NftDetectionController.test.ts b/packages/assets-controllers/src/NftDetectionController.test.ts index fa4101e778f..d485a77361f 100644 --- a/packages/assets-controllers/src/NftDetectionController.test.ts +++ b/packages/assets-controllers/src/NftDetectionController.test.ts @@ -833,8 +833,6 @@ describe('NftDetectionController', () => { it('should not call addNFt when the request to Nft API call throws', async () => { const selectedAccount = createMockInternalAccount({ address: '0x3' }); nock(NFT_API_BASE_URL) - // ESLint is confused; this is a string. - .get(`/users/${selectedAccount.address}/tokens`) .query({ continuation: '', diff --git a/packages/assets-controllers/src/TokenRatesController.ts b/packages/assets-controllers/src/TokenRatesController.ts index eebaaf56482..8163ab3be20 100644 --- a/packages/assets-controllers/src/TokenRatesController.ts +++ b/packages/assets-controllers/src/TokenRatesController.ts @@ -34,7 +34,7 @@ import type { } from './TokensController'; /** - * Token + * @type Token * * Token representation * diff --git a/packages/assets-controllers/src/multicall.test.ts b/packages/assets-controllers/src/multicall.test.ts index a39e61a03da..92f6199c9c9 100644 --- a/packages/assets-controllers/src/multicall.test.ts +++ b/packages/assets-controllers/src/multicall.test.ts @@ -71,12 +71,10 @@ describe('multicall', () => { expect(results).toMatchObject([ { success: true, - value: { _hex: '0x01' }, }, { success: true, - value: { _hex: '0x02' }, }, ]); @@ -126,12 +124,10 @@ describe('multicall', () => { expect(results).toMatchObject([ { success: true, - value: { _hex: '0x01' }, }, { success: true, - value: { _hex: '0x02' }, }, ]); @@ -166,7 +162,6 @@ describe('multicall', () => { expect(results).toMatchObject([ { success: true, - value: { _hex: '0x01' }, }, ]); diff --git a/packages/composable-controller/src/ComposableController.ts b/packages/composable-controller/src/ComposableController.ts index 6a2d4438ee9..594e10e41f3 100644 --- a/packages/composable-controller/src/ComposableController.ts +++ b/packages/composable-controller/src/ComposableController.ts @@ -195,8 +195,6 @@ export class ComposableController< }); }); } catch (error: unknown) { - // False negative. `name` is a string type. - console.error(`${name} - ${String(error)}`); } } diff --git a/packages/controller-utils/src/siwe.ts b/packages/controller-utils/src/siwe.ts index 1f4650e7f6b..f2e4898ba04 100644 --- a/packages/controller-utils/src/siwe.ts +++ b/packages/controller-utils/src/siwe.ts @@ -37,7 +37,7 @@ function msgHexToText(hex: string): string { } /** - * WrappedSIWERequest + * @type WrappedSIWERequest * * Sign-In With Ethereum (SIWE)(EIP-4361) message with request metadata * diff --git a/packages/ens-controller/src/EnsController.ts b/packages/ens-controller/src/EnsController.ts index 4d7007ca8eb..0f9a1da71c8 100644 --- a/packages/ens-controller/src/EnsController.ts +++ b/packages/ens-controller/src/EnsController.ts @@ -46,7 +46,7 @@ export const DEFAULT_ENS_NETWORK_MAP: Record = { }; /** - * EnsEntry + * @type EnsEntry * * ENS entry representation * @@ -61,11 +61,11 @@ export type EnsEntry = { }; /** - * EnsControllerState + * @type EnsControllerState * * ENS controller state * - * ensEntries - Object of ENS entry objects + * @property ensEntries - Object of ENS entry objects */ export type EnsControllerState = { ensEntries: { diff --git a/packages/gas-fee-controller/src/GasFeeController.test.ts b/packages/gas-fee-controller/src/GasFeeController.test.ts index e1c2290e0fd..aa69131f30b 100644 --- a/packages/gas-fee-controller/src/GasFeeController.test.ts +++ b/packages/gas-fee-controller/src/GasFeeController.test.ts @@ -307,7 +307,6 @@ describe('GasFeeController', () => { getIsEIP1559Compatible?: jest.Mock>; getCurrentNetworkLegacyGasAPICompatibility?: jest.Mock; legacyAPIEndpoint?: string; - EIP1559APIEndpoint?: string; clientId?: string; networkControllerState?: Partial; diff --git a/packages/gas-fee-controller/src/GasFeeController.ts b/packages/gas-fee-controller/src/GasFeeController.ts index e46361d0d55..f68a381ac24 100644 --- a/packages/gas-fee-controller/src/GasFeeController.ts +++ b/packages/gas-fee-controller/src/GasFeeController.ts @@ -76,13 +76,13 @@ export type EstimatedGasFeeTimeBounds = { }; /** - * EthGasPriceEstimate + * @type EthGasPriceEstimate * * A single gas price estimate for networks and accounts that don't support EIP-1559 * This estimate comes from eth_gasPrice but is converted to dec gwei to match other * return values * - * gasPrice - A GWEI dec string + * @property gasPrice - A GWEI dec string */ export type EthGasPriceEstimate = { @@ -90,7 +90,7 @@ export type EthGasPriceEstimate = { }; /** - * LegacyGasPriceEstimate + * @type LegacyGasPriceEstimate * * A set of gas price estimates for networks and accounts that don't support EIP-1559 * These estimates include low, medium and high all as strings representing gwei in @@ -107,7 +107,7 @@ export type LegacyGasPriceEstimate = { }; /** - * Eip1559GasFee + * @type Eip1559GasFee * * Data necessary to provide an estimate of a gas fee with a specific tip * @@ -124,7 +124,7 @@ export type Eip1559GasFee = { }; /** - * GasFeeEstimates + * @type GasFeeEstimates * * Data necessary to provide multiple GasFee estimates, and supporting information, to the user * @@ -226,7 +226,7 @@ export type FetchGasFeeEstimateOptions = { }; /** - * GasFeeState + * @type GasFeeState * * Gas Fee controller state * @@ -364,7 +364,6 @@ export class GasFeeController extends StaticIntervalPollingController ProviderProxy; onNetworkDidChange?: (listener: (state: NetworkState) => void) => void; legacyAPIEndpoint?: string; - EIP1559APIEndpoint: string; clientId?: string; }) { diff --git a/packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts b/packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts index 387c3678402..38f502f819e 100644 --- a/packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts +++ b/packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts @@ -121,8 +121,6 @@ export default function createStreamMiddleware(options: Options = {}) { Object.assign(context.res, res); // run callback on empty stack, // prevent internal stream-handler from catching errors - // TODO: remove eslint-disable once issue #1989 is resolved. - setTimeout(context.end); } diff --git a/packages/logging-controller/src/LoggingController.test.ts b/packages/logging-controller/src/LoggingController.test.ts index a1123499500..0a65f2b57da 100644 --- a/packages/logging-controller/src/LoggingController.test.ts +++ b/packages/logging-controller/src/LoggingController.test.ts @@ -15,8 +15,6 @@ import { SigningMethod, SigningStage } from './logTypes/EthSignLog'; jest.mock('uuid', () => { return { - // We need to use this name as this is what Jest recognizes. - __esModule: true, ...jest.requireActual('uuid'), }; diff --git a/packages/logging-controller/src/LoggingController.ts b/packages/logging-controller/src/LoggingController.ts index 07efef2cb2b..05f8e092832 100644 --- a/packages/logging-controller/src/LoggingController.ts +++ b/packages/logging-controller/src/LoggingController.ts @@ -23,7 +23,7 @@ export type LogEntry = { /** * Logging controller state * - * logs - An object of logs indexed by their ids + * @property logs - An object of logs indexed by their ids */ export type LoggingControllerState = { logs: { diff --git a/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts b/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts index 6cc27c9e1e3..f9c4b4398de 100644 --- a/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts +++ b/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts @@ -35,7 +35,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { mockNext, (error) => { // This is okay; we'll get what we get. - reject(error); }, ); @@ -46,7 +45,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -93,7 +91,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - reject(e); } }, @@ -105,7 +102,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -152,7 +148,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - reject(e); } }, @@ -164,7 +159,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -216,7 +210,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - reject(e); } }, @@ -228,7 +221,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -263,7 +255,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { mockNext, (error) => { // This is okay; we'll get what we get. - reject(error); }, ); @@ -274,7 +265,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -325,7 +315,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - reject(e); } }, @@ -337,7 +326,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -361,7 +349,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { mockNext, (error) => { // This is okay; we'll get what we get. - reject(error); }, ); @@ -372,7 +359,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -397,7 +383,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { mockNext, (error) => { // This is okay; we'll get what we get. - reject(error); }, ); @@ -408,7 +393,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -440,7 +424,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - reject(e); } }, @@ -452,7 +435,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); @@ -494,7 +476,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (e) { // This is okay; we'll get what we get. - reject(e); } }, @@ -506,7 +487,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { resolve(); } catch (error) { // This is okay; we'll get what we get. - reject(error); } }); diff --git a/packages/network-controller/src/NetworkController.ts b/packages/network-controller/src/NetworkController.ts index 979758a099b..5863aa1de35 100644 --- a/packages/network-controller/src/NetworkController.ts +++ b/packages/network-controller/src/NetworkController.ts @@ -705,8 +705,6 @@ function getDefaultInfuraNetworkConfigurationsByChainId(): Record< } const rpcEndpointUrl = - // False positive - this is a string. - `https://${infuraNetworkType}.infura.io/v3/{infuraProjectId}` as const; const networkConfiguration: NetworkConfiguration = { diff --git a/packages/network-controller/tests/network-client/helpers.ts b/packages/network-controller/tests/network-client/helpers.ts index 3ec20ed768b..4f0dcb128ea 100644 --- a/packages/network-controller/tests/network-client/helpers.ts +++ b/packages/network-controller/tests/network-client/helpers.ts @@ -430,8 +430,6 @@ export async function waitForPromiseToBeFulfilledAfterRunningAllTimers( let hasPromiseBeenFulfilled = false; let numTimesClockHasBeenAdvanced = 0; - // This is a mistake, we are catching this promise. - promise // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/permission-controller/src/PermissionController.test.ts b/packages/permission-controller/src/PermissionController.test.ts index 57513804017..16c6768905e 100644 --- a/packages/permission-controller/src/PermissionController.test.ts +++ b/packages/permission-controller/src/PermissionController.test.ts @@ -6207,8 +6207,6 @@ describe('PermissionController', () => { 'Unauthorized to perform action. Try requesting the required permission(s) first. For more information, see: https://docs.metamask.io/guide/rpc-api.html#permissions', }); - // ESLint is confused; this signature is async. - const response = await engine.handle(request); assertIsJsonRpcFailure(response); expect(response.error).toMatchObject( @@ -6231,8 +6229,6 @@ describe('PermissionController', () => { const expectedError = errors.methodNotFound('wallet_foo', { origin }); - // ESLint is confused; this signature is async. - const response = await engine.handle(request); assertIsJsonRpcFailure(response); const { error } = response; @@ -6282,8 +6278,6 @@ describe('PermissionController', () => { { request: { ...request } }, ); - // ESLint is confused; this signature is async. - const response = await engine.handle(request); assertIsJsonRpcFailure(response); const { error } = response; diff --git a/packages/permission-controller/src/SubjectMetadataController.ts b/packages/permission-controller/src/SubjectMetadataController.ts index 7af3c599908..a74f7cc0cab 100644 --- a/packages/permission-controller/src/SubjectMetadataController.ts +++ b/packages/permission-controller/src/SubjectMetadataController.ts @@ -145,15 +145,11 @@ export class SubjectMetadataController extends BaseController< this.subjectsWithoutPermissionsEncounteredSinceStartup = new Set(); this.messenger.registerActionHandler( - // ESLint is confused by the string literal type. - `${this.name}:getSubjectMetadata`, this.getSubjectMetadata.bind(this), ); this.messenger.registerActionHandler( - // ESLint is confused by the string literal type. - `${this.name}:addSubjectMetadata`, this.addSubjectMetadata.bind(this), ); diff --git a/packages/permission-controller/src/rpc-methods/revokePermissions.test.ts b/packages/permission-controller/src/rpc-methods/revokePermissions.test.ts index 8dc1ea102a9..60465a1b475 100644 --- a/packages/permission-controller/src/rpc-methods/revokePermissions.test.ts +++ b/packages/permission-controller/src/rpc-methods/revokePermissions.test.ts @@ -83,8 +83,6 @@ describe('revokePermissions RPC method', () => { .serialize(); delete expectedError.stack; - // ESLint is confused; this signature is async. - const response = await engine.handle(req); assertIsJsonRpcFailure(response); delete response.error.stack; @@ -120,8 +118,6 @@ describe('revokePermissions RPC method', () => { .serialize(); delete expectedError.stack; - // ESLint is confused; this signature is async. - const response = await engine.handle(req); assertIsJsonRpcFailure(response); delete response.error.stack; @@ -156,8 +152,6 @@ describe('revokePermissions RPC method', () => { .serialize(); delete expectedError.stack; - // ESLint is confused; this signature is async. - const response = await engine.handle(req); assertIsJsonRpcFailure(response); delete response.error.stack; @@ -193,8 +187,6 @@ describe('revokePermissions RPC method', () => { .serialize(); delete expectedError.stack; - // ESLint is confused; this signature is async. - const response = await engine.handle(req); assertIsJsonRpcFailure(response); delete response.error.stack; diff --git a/packages/phishing-controller/src/PhishingController.ts b/packages/phishing-controller/src/PhishingController.ts index 172d6ea4b42..e11b622aaf9 100644 --- a/packages/phishing-controller/src/PhishingController.ts +++ b/packages/phishing-controller/src/PhishingController.ts @@ -79,7 +79,7 @@ export const METAMASK_HOTLIST_DIFF_URL = `${PHISHING_CONFIG_BASE_URL}${METAMASK_ export const C2_DOMAIN_BLOCKLIST_URL = `${CLIENT_SIDE_DETECION_BASE_URL}${C2_DOMAIN_BLOCKLIST_ENDPOINT}`; /** - * ListTypes + * @type ListTypes * * Type outlining the types of lists provided by aggregating different source lists */ @@ -91,7 +91,7 @@ export type ListTypes = | 'c2DomainBlocklist'; /** - * EthPhishingResponse + * @type EthPhishingResponse * * Configuration response from the eth-phishing-detect package * consisting of approved and unapproved website origins @@ -111,7 +111,7 @@ export type EthPhishingResponse = { }; /** - * C2DomainBlocklistResponse + * @type C2DomainBlocklistResponse * * Response for blocklist update requests * @@ -147,7 +147,7 @@ export type PhishingStalelist = { }; /** - * PhishingListState + * @type PhishingListState * * type defining the persisted list state. This is the persisted state that is updated frequently with `this.maybeUpdateState()`. * @@ -174,7 +174,7 @@ export type PhishingListState = { }; /** - * HotlistDiff + * @type HotlistDiff * * type defining the expected type of the diffs in hotlist.json file. * @@ -195,7 +195,7 @@ export type DataResultWrapper = { }; /** - * Hotlist + * @type Hotlist * * Type defining expected hotlist.json file. * @@ -309,7 +309,7 @@ const getDefaultState = (): PhishingControllerState => { }; /** - * PhishingControllerState + * @type PhishingControllerState * * Phishing controller state * phishingLists - array of phishing lists diff --git a/packages/rate-limit-controller/src/RateLimitController.ts b/packages/rate-limit-controller/src/RateLimitController.ts index a693239c666..f41a650ce7c 100644 --- a/packages/rate-limit-controller/src/RateLimitController.ts +++ b/packages/rate-limit-controller/src/RateLimitController.ts @@ -37,7 +37,7 @@ export type RateLimitedRequests = * The state of the {@link RateLimitController}. * * @template RateLimitedApis - A {@link RateLimitedApiMap} containing the rate-limited API endpoints that is used by the {@link RateLimitController}. - * requests - An object containing the number of requests made in a given interval for each origin and api type combination. + * @property requests - An object containing the number of requests made in a given interval for each origin and api type combination. */ export type RateLimitState = { requests: RateLimitedRequests; diff --git a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts index 90d5b8ddf79..1796ea2bd6e 100644 --- a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts +++ b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts @@ -297,8 +297,6 @@ describe('SampleGasPricesService', () => { type RootMessenger = Messenger< MockAnyNamespace, MessengerActions, - // TODO: Disable this lint rule - MessengerEvents >; diff --git a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts index 8caa5f8e588..15611143ec8 100644 --- a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts +++ b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts @@ -52,8 +52,6 @@ type AllowedEvents = never; export type SampleGasPricesServiceMessenger = Messenger< typeof serviceName, SampleGasPricesServiceActions | AllowedActions, - // TODO: Disable this lint rule - SampleGasPricesServiceEvents | AllowedEvents >; diff --git a/tests/fake-provider.ts b/tests/fake-provider.ts index 7417d5871f3..f46b314b03a 100644 --- a/tests/fake-provider.ts +++ b/tests/fake-provider.ts @@ -47,6 +47,7 @@ export type FakeProviderResponse = { result: any } | { error: string }; * @property request.method - The RPC method to which this stub will be matched. * @property request.params - The params to which this stub will be matched. * @property response - Instructs `request` to return a promise that resolves + * with a response object. * @property response.result - Specifies a successful response, with this as the * `result`. * @property response.error - Specifies an error response, with this as the From 9b9c6f9ec5d7b8becaf48bf0e765056c774172d8 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 10 Nov 2025 15:05:12 -0330 Subject: [PATCH 4/6] Remove extra newlines Co-authored-by: Maarten Zuidhoorn --- packages/message-manager/src/AbstractMessageManager.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/message-manager/src/AbstractMessageManager.ts b/packages/message-manager/src/AbstractMessageManager.ts index 011af627af8..14054ed42a7 100644 --- a/packages/message-manager/src/AbstractMessageManager.ts +++ b/packages/message-manager/src/AbstractMessageManager.ts @@ -81,7 +81,6 @@ export type AbstractMessage = { * @property origin? - Added for request origin identification * @property requestId? - Original request id * @property deferSetAsSigned? - Whether to defer setting the message as signed immediately after the keyring is told to sign it - * */ export type AbstractMessageParams = { from: string; @@ -99,7 +98,6 @@ export type AbstractMessageParams = { * @property metamaskId - Added for tracking and identification within MetaMask * @property from - Address from which the message is processed * @property origin? - Added for request origin identification - * */ export type AbstractMessageParamsMetamask = AbstractMessageParams & { metamaskId?: string; From 793e50b993257b1e7ff2579b5c6b10659ac5bbb4 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 10 Nov 2025 15:07:49 -0330 Subject: [PATCH 5/6] Remove obsolete comments --- ...chainMethodCallValidatorMiddleware.test.ts | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts b/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts index f9c4b4398de..baaf1daf6b3 100644 --- a/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts +++ b/packages/multichain-api-middleware/src/middlewares/multichainMethodCallValidatorMiddleware.test.ts @@ -34,7 +34,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { response, mockNext, (error) => { - // This is okay; we'll get what we get. reject(error); }, ); @@ -44,7 +43,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -90,7 +88,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { ); resolve(); } catch (e) { - // This is okay; we'll get what we get. reject(e); } }, @@ -101,7 +98,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).not.toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -147,7 +143,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { ); resolve(); } catch (e) { - // This is okay; we'll get what we get. reject(e); } }, @@ -158,7 +153,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).not.toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -209,7 +203,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { ); resolve(); } catch (e) { - // This is okay; we'll get what we get. reject(e); } }, @@ -220,7 +213,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).not.toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -254,7 +246,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { response, mockNext, (error) => { - // This is okay; we'll get what we get. reject(error); }, ); @@ -264,7 +255,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -314,7 +304,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { ); resolve(); } catch (e) { - // This is okay; we'll get what we get. reject(e); } }, @@ -325,7 +314,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).not.toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -348,7 +336,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { response, mockNext, (error) => { - // This is okay; we'll get what we get. reject(error); }, ); @@ -358,7 +345,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -382,7 +368,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { response, mockNext, (error) => { - // This is okay; we'll get what we get. reject(error); }, ); @@ -392,7 +377,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -423,7 +407,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { ); resolve(); } catch (e) { - // This is okay; we'll get what we get. reject(e); } }, @@ -434,7 +417,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).not.toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); @@ -475,7 +457,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { ); resolve(); } catch (e) { - // This is okay; we'll get what we get. reject(e); } }, @@ -486,7 +467,6 @@ describe('multichainMethodCallValidatorMiddleware', () => { expect(mockNext).not.toHaveBeenCalled(); resolve(); } catch (error) { - // This is okay; we'll get what we get. reject(error); } }); From cf8849fe584445e390e8c2d4efb595b09e56d124 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 10 Nov 2025 15:14:11 -0330 Subject: [PATCH 6/6] Update warning threshold --- eslint-warning-thresholds.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eslint-warning-thresholds.json b/eslint-warning-thresholds.json index 6d1b232dd25..52125a19d86 100644 --- a/eslint-warning-thresholds.json +++ b/eslint-warning-thresholds.json @@ -249,8 +249,7 @@ "jest/no-conditional-in-test": 7 }, "packages/message-manager/src/AbstractMessageManager.ts": { - "jsdoc/check-tag-names": 25, - "jsdoc/tag-lines": 2 + "jsdoc/check-tag-names": 25 }, "packages/message-manager/src/DecryptMessageManager.test.ts": { "jest/no-conditional-in-test": 3