Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 9 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const config = createConfig([
camelcase: 'off',
'id-length': 'off',

// TODO: Re-enable this rule
// Enabling it with error suppression breaks `--fix`, because the autofixer for this rule
// does not work very well.
'jsdoc/require-jsdoc': 'off',

// TODO: re-enble most of these rules
'id-denylist': 'off',
'import-x/no-unassigned-import': 'off',
Expand Down Expand Up @@ -123,10 +128,11 @@ const config = createConfig([
// TODO: auto-fix breaks stuff
'@typescript-eslint/promise-function-async': 'off',

// TODO: Re-enable this rule
// Enabling it with error suppression breaks `--fix`, because the autofixer for this rule
// does not work very well.
// TODO: Re-enable these rules
// Enabling them with error suppression breaks `--fix`, because the autofixer for these rules
// do not work very well.
'jsdoc/check-tag-names': 'off',
'jsdoc/require-jsdoc': 'off',

// TODO: re-enable most of these rules
'@typescript-eslint/naming-convention': 'off',
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
"@lavamoat/allow-scripts": "^3.0.4",
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/create-release-branch": "^4.1.3",
"@metamask/eslint-config": "^14.1.0",
"@metamask/eslint-config-jest": "^14.1.0",
"@metamask/eslint-config-nodejs": "^14.0.0",
"@metamask/eslint-config-typescript": "^14.1.0",
"@metamask/eslint-config": "^15.0.0",
"@metamask/eslint-config-jest": "^15.0.0",
"@metamask/eslint-config-nodejs": "^15.0.0",
"@metamask/eslint-config-typescript": "^15.0.0",
"@metamask/eth-block-tracker": "^15.0.0",
"@metamask/eth-json-rpc-provider": "^6.0.0",
"@metamask/json-rpc-engine": "^10.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import type { AccountWalletId, Bip44Account } from '@metamask/account-api';
import type {
AccountGroupId,
AccountWalletId,
Bip44Account,
} from '@metamask/account-api';
import {
AccountGroupType,
AccountWalletType,
toAccountGroupId,
toAccountWalletId,
toMultichainAccountGroupId,
toMultichainAccountWalletId,
type AccountGroupId,
} from '@metamask/account-api';
import type { AccountId } from '@metamask/accounts-controller';
import { deriveStateFromMetadata } from '@metamask/base-controller';
Expand Down Expand Up @@ -36,7 +39,7 @@ import type { BackupAndSyncAnalyticsEventPayload } from './backup-and-sync/analy
import { BackupAndSyncService } from './backup-and-sync/service';
import { isAccountGroupNameUnique } from './group';
import { getAccountWalletNameFromKeyringType } from './rules/keyring';
import { type AccountTreeControllerState } from './types';
import type { AccountTreeControllerState } from './types';
import {
getAccountTreeControllerMessenger,
getRootMessenger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
AccountGroupType,
} from '@metamask/account-api';
import type { MultichainAccountWalletStatus } from '@metamask/account-api';
import { type AccountId } from '@metamask/accounts-controller';
import type { AccountId } from '@metamask/accounts-controller';
import type { StateMetadata } from '@metamask/base-controller';
import { BaseController } from '@metamask/base-controller';
import type { TraceCallback } from '@metamask/controller-utils';
Expand Down Expand Up @@ -40,7 +40,7 @@ import type {
AccountTreeControllerMessenger,
AccountTreeControllerState,
} from './types';
import { type AccountWalletObject, type AccountWalletObjectOf } from './wallet';
import type { AccountWalletObject, AccountWalletObjectOf } from './wallet';

export const controllerName = 'AccountTreeController';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
BackupAndSyncAnalyticsEvent,
formatAnalyticsEvent,
type BackupAndSyncAnalyticsAction,
type BackupAndSyncEmitAnalyticsEventParams,
type BackupAndSyncAnalyticsEventPayload,
import { BackupAndSyncAnalyticsEvent, formatAnalyticsEvent } from './segment';
import type {
BackupAndSyncAnalyticsAction,
BackupAndSyncEmitAnalyticsEventParams,
BackupAndSyncAnalyticsEventPayload,
} from './segment';

describe('BackupAndSyncAnalytics - Segment', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import type { AccountWalletEntropyObject } from '../../wallet';
import type { BackupAndSyncAnalyticsAction } from '../analytics';
import { BackupAndSyncAnalyticsEvent } from '../analytics';
import type { ProfileId } from '../authentication';
import {
UserStorageSyncedWalletGroupSchema,
type BackupAndSyncContext,
type UserStorageSyncedWalletGroup,
import { UserStorageSyncedWalletGroupSchema } from '../types';
import type {
BackupAndSyncContext,
UserStorageSyncedWalletGroup,
} from '../types';
import {
pushGroupToUserStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { backupAndSyncLogger } from '../../logger';
import type { AccountWalletEntropyObject } from '../../wallet';
import { BackupAndSyncAnalyticsEvent } from '../analytics';
import type { ProfileId } from '../authentication';
import {
UserStorageSyncedWalletSchema,
type BackupAndSyncContext,
type UserStorageSyncedWallet,
} from '../types';
import { UserStorageSyncedWalletSchema } from '../types';
import type { BackupAndSyncContext, UserStorageSyncedWallet } from '../types';
import { pushWalletToUserStorage } from '../user-storage/network-operations';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import type {
} from '@metamask/account-api';
import type { TraceCallback } from '@metamask/controller-utils';
import type { InternalAccount } from '@metamask/keyring-internal-api';
import type { Infer } from '@metamask/superstruct';
import {
object,
string,
boolean,
number,
optional,
type Struct,
} from '@metamask/superstruct';
import type { Infer, Struct } from '@metamask/superstruct';

import type { BackupAndSyncEmitAnalyticsEventParams } from './analytics';
import type { AccountTreeController } from '../AccountTreeController';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
getLocalGroupsForEntropyWallet,
createStateSnapshot,
restoreStateFromSnapshot,
type StateSnapshot,
getLocalGroupForEntropyWallet,
} from './controller';
import type { StateSnapshot } from './controller';
import type { AccountTreeController } from '../../AccountTreeController';
import type {
AccountWalletEntropyObject,
Expand Down
8 changes: 4 additions & 4 deletions packages/account-tree-controller/src/group.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
type AccountGroupType,
type MultichainAccountGroupId,
import type {
AccountGroupType,
MultichainAccountGroupId,
} from '@metamask/account-api';
import type { AccountGroupId } from '@metamask/account-api';
import type { AccountId } from '@metamask/accounts-controller';
import {
AnyAccountType,
BtcAccountType,
EthAccountType,
type KeyringAccountType,
SolAccountType,
TrxAccountType,
} from '@metamask/keyring-api';
import type { KeyringAccountType } from '@metamask/keyring-api';

import type { UpdatableField, ExtractFieldValues } from './type-utils';
import type { AccountTreeControllerState } from './types';
Expand Down
3 changes: 2 additions & 1 deletion packages/account-tree-controller/src/rules/entropy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { KeyringTypes } from '@metamask/keyring-controller';
import type { InternalAccount } from '@metamask/keyring-internal-api';

import type { AccountGroupObjectOf } from '../group';
import { BaseRule, type Rule, type RuleResult } from '../rule';
import { BaseRule } from '../rule';
import type { Rule, RuleResult } from '../rule';
import type { AccountWalletObjectOf } from '../wallet';

export class EntropyRule
Expand Down
3 changes: 2 additions & 1 deletion packages/account-tree-controller/src/rules/keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { KeyringTypes } from '@metamask/keyring-controller';
import type { InternalAccount } from '@metamask/keyring-internal-api';

import type { AccountGroupObjectOf } from '../group';
import { BaseRule, type Rule, type RuleResult } from '../rule';
import { BaseRule } from '../rule';
import type { Rule, RuleResult } from '../rule';
import type { AccountWalletObjectOf } from '../wallet';

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/account-tree-controller/src/rules/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import type { SnapId } from '@metamask/snaps-sdk';
import { stripSnapPrefix } from '@metamask/snaps-utils';

import { getAccountGroupPrefixFromKeyringType } from './keyring';
import { BaseRule, type Rule, type RuleResult } from '../rule';
import { BaseRule } from '../rule';
import type { Rule, RuleResult } from '../rule';
import type { AccountWalletObjectOf } from '../wallet';

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/account-tree-controller/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import type {
AccountsControllerSelectedAccountChangeEvent,
AccountsControllerSetSelectedAccountAction,
} from '@metamask/accounts-controller';
import {
type ControllerGetStateAction,
type ControllerStateChangeEvent,
import type {
ControllerGetStateAction,
ControllerStateChangeEvent,
} from '@metamask/base-controller';
import type { TraceCallback } from '@metamask/controller-utils';
import type { KeyringControllerGetStateAction } from '@metamask/keyring-controller';
Expand Down
2 changes: 1 addition & 1 deletion packages/account-tree-controller/src/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type AccountGroupId } from '@metamask/account-api';
import type { AccountGroupId } from '@metamask/account-api';
import type {
AccountWalletType,
AccountWalletId,
Expand Down
11 changes: 5 additions & 6 deletions packages/account-tree-controller/tests/mockMessenger.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
Messenger,
MOCK_ANY_NAMESPACE,
type MockAnyNamespace,
type MessengerActions,
type MessengerEvents,
import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger';
import type {
MockAnyNamespace,
MessengerActions,
MessengerEvents,
} from '@metamask/messenger';

import type { AccountTreeControllerMessenger } from '../src/types';
Expand Down
11 changes: 5 additions & 6 deletions packages/accounts-controller/src/AccountsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ import {
} from '@metamask/keyring-api';
import { KeyringTypes } from '@metamask/keyring-controller';
import type { InternalAccount } from '@metamask/keyring-internal-api';
import {
MOCK_ANY_NAMESPACE,
Messenger,
type MessengerActions,
type MessengerEvents,
type MockAnyNamespace,
import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger';
import type {
MessengerActions,
MessengerEvents,
MockAnyNamespace,
} from '@metamask/messenger';
import type { NetworkClientId } from '@metamask/network-controller';
import type { SnapControllerState } from '@metamask/snaps-controllers';
Expand Down
35 changes: 18 additions & 17 deletions packages/accounts-controller/src/AccountsController.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
type ControllerGetStateAction,
type ControllerStateChangeEvent,
BaseController,
import { BaseController } from '@metamask/base-controller';
import type {
ControllerGetStateAction,
ControllerStateChangeEvent,
} from '@metamask/base-controller';
import {
type SnapKeyringAccountAssetListUpdatedEvent,
type SnapKeyringAccountBalancesUpdatedEvent,
type SnapKeyringAccountTransactionsUpdatedEvent,
SnapKeyring,
import { SnapKeyring } from '@metamask/eth-snap-keyring';
import type {
SnapKeyringAccountAssetListUpdatedEvent,
SnapKeyringAccountBalancesUpdatedEvent,
SnapKeyringAccountTransactionsUpdatedEvent,
} from '@metamask/eth-snap-keyring';
import type { KeyringAccountEntropyOptions } from '@metamask/keyring-api';
import {
Expand All @@ -17,13 +17,13 @@ import {
isEvmAccountType,
KeyringAccountEntropyTypeOption,
} from '@metamask/keyring-api';
import type { KeyringObject } from '@metamask/keyring-controller';
import {
type KeyringControllerState,
type KeyringControllerGetKeyringsByTypeAction,
type KeyringControllerStateChangeEvent,
type KeyringControllerGetStateAction,
KeyringTypes,
import { KeyringTypes } from '@metamask/keyring-controller';
import type {
KeyringControllerState,
KeyringControllerGetKeyringsByTypeAction,
KeyringControllerStateChangeEvent,
KeyringControllerGetStateAction,
KeyringObject,
} from '@metamask/keyring-controller';
import type { InternalAccount } from '@metamask/keyring-internal-api';
import { isScopeEqualToAny } from '@metamask/keyring-utils';
Expand All @@ -34,7 +34,8 @@ import type {
SnapStateChange,
} from '@metamask/snaps-controllers';
import type { SnapId } from '@metamask/snaps-sdk';
import { type CaipChainId, isCaipChainId } from '@metamask/utils';
import { isCaipChainId } from '@metamask/utils';
import type { CaipChainId } from '@metamask/utils';
import type { WritableDraft } from 'immer/dist/internal.js';
import { cloneDeep } from 'lodash';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { deriveStateFromMetadata } from '@metamask/base-controller';
import { toHex } from '@metamask/controller-utils';
import {
Messenger,
MOCK_ANY_NAMESPACE,
type MessengerActions,
type MessengerEvents,
type MockAnyNamespace,
import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger';
import type {
MessengerActions,
MessengerEvents,
MockAnyNamespace,
} from '@metamask/messenger';
import type { Hex } from '@metamask/utils';

Expand Down
20 changes: 8 additions & 12 deletions packages/analytics-controller/src/AnalyticsController.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import {
Messenger,
MOCK_ANY_NAMESPACE,
type MockAnyNamespace,
} from '@metamask/messenger';
import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger';
import type { MockAnyNamespace } from '@metamask/messenger';
import { validate as uuidValidate, version as uuidVersion } from 'uuid';

import {
AnalyticsController,
type AnalyticsControllerMessenger,
type AnalyticsControllerActions,
type AnalyticsControllerEvents,
type AnalyticsPlatformAdapter,
getDefaultAnalyticsControllerState,
import { AnalyticsController, getDefaultAnalyticsControllerState } from '.';
import type {
AnalyticsControllerMessenger,
AnalyticsControllerActions,
AnalyticsControllerEvents,
AnalyticsPlatformAdapter,
} from '.';
import type { AnalyticsControllerState } from '.';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { deriveStateFromMetadata } from '@metamask/base-controller';
import {
Messenger,
MOCK_ANY_NAMESPACE,
type MockAnyNamespace,
} from '@metamask/messenger';
import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger';
import type { MockAnyNamespace } from '@metamask/messenger';

import type {
AnnouncementControllerState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { deriveStateFromMetadata } from '@metamask/base-controller';
import {
Messenger,
MOCK_ANY_NAMESPACE,
type MockAnyNamespace,
} from '@metamask/messenger';
import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger';
import type { MockAnyNamespace } from '@metamask/messenger';

import {
AppMetadataController,
getDefaultAppMetadataControllerState,
type AppMetadataControllerOptions,
type AppMetadataControllerActions,
type AppMetadataControllerEvents,
} from './AppMetadataController';
import type {
AppMetadataControllerOptions,
AppMetadataControllerActions,
AppMetadataControllerEvents,
} from './AppMetadataController';

describe('AppMetadataController', () => {
Expand Down
Loading
Loading