Skip to content

Commit df5da81

Browse files
committed
chore: Remove unused ESLint directives about enum comparisons
ESLint ignore directives about the rule `no-unusafe-enum-comparison` have been removed. This rule was disabled in the most recent ESLint config update. This change helps to unblock #7148
1 parent a7a7612 commit df5da81

File tree

5 files changed

+0
-15
lines changed

5 files changed

+0
-15
lines changed

packages/chain-agnostic-permission/src/operators/caip-permission-operator-accounts.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ const isEip155ScopeString = (scopeString: InternalScopeString) => {
3737

3838
return (
3939
namespace === KnownCaipNamespace.Eip155 ||
40-
// We are trying to discern the type of `scopeString`.
41-
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
4240
scopeString === KnownWalletScopeString.Eip155
4341
);
4442
};
@@ -321,7 +319,6 @@ function isAddressWithParsedScopesInPermittedAccountIds(
321319
return parsedAccountScopes.some(({ namespace, reference }) => {
322320
if (
323321
namespace !== parsedPermittedAccount.chain.namespace &&
324-
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
325322
parsedPermittedAccount.chain.namespace !== KnownCaipNamespace.Wallet
326323
) {
327324
return false;
@@ -330,7 +327,6 @@ function isAddressWithParsedScopesInPermittedAccountIds(
330327
// handle wallet:<namespace>:<address> case where namespaces are mismatched but addresses match
331328
// i.e. wallet:notSolana:12389812309123 and solana:0:12389812309123
332329
if (
333-
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
334330
parsedPermittedAccount.chain.namespace === KnownCaipNamespace.Wallet &&
335331
namespace !== parsedPermittedAccount.chain.reference
336332
) {
@@ -348,7 +344,6 @@ function isAddressWithParsedScopesInPermittedAccountIds(
348344

349345
// handle wallet:<namespace>:<address> case
350346
if (
351-
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
352347
parsedPermittedAccount.chain.namespace === KnownCaipNamespace.Wallet
353348
) {
354349
return address === parsedPermittedAccount.address;

packages/chain-agnostic-permission/src/scope/assert.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ export function assertIsInternalScopeString(
253253
typeof scopeString !== 'string' ||
254254
// `InternalScopeString` is defined as either `KnownCaipNamespace.Wallet` or
255255
// `CaipChainId`, so our conditions intentionally match the type.
256-
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
257256
(scopeString !== KnownCaipNamespace.Wallet && !isCaipChainId(scopeString))
258257
) {
259258
throw new Error('scopeString is not a valid InternalScopeString');

packages/chain-agnostic-permission/src/scope/supported.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ export const isSupportedAccount = (
9595
const isSupportedNonEvmAccount = () =>
9696
getNonEvmAccountAddresses(chainId).includes(account);
9797

98-
// We are trying to discern the type of `namespace`.
99-
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
10098
switch (namespace) {
10199
case KnownCaipNamespace.Wallet:
102100
if (reference === KnownCaipNamespace.Eip155) {
@@ -108,7 +106,6 @@ export const isSupportedAccount = (
108106
default:
109107
return isSupportedNonEvmAccount();
110108
}
111-
/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
112109
};
113110

114111
/**
@@ -139,8 +136,6 @@ export const isSupportedMethod = (
139136
isCaipChainId(scopeString) &&
140137
getNonEvmSupportedMethods(scopeString).includes(method);
141138

142-
// We are trying to discern the type of `namespace`.
143-
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
144139
if (namespace === KnownCaipNamespace.Wallet) {
145140
if (!reference) {
146141
return KnownWalletRpcMethods.includes(method);
@@ -156,7 +151,6 @@ export const isSupportedMethod = (
156151
if (namespace === KnownCaipNamespace.Eip155) {
157152
return KnownRpcMethods[namespace].includes(method);
158153
}
159-
/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
160154

161155
return isSupportedNonEvmMethod();
162156
};

packages/keyring-controller/src/KeyringController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,6 @@ export class KeyringController<
18961896
throw new Error(KeyringControllerError.KeyringNotFound);
18971897
}
18981898

1899-
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
19001899
if (keyring.type !== KeyringTypes.hd) {
19011900
throw new Error(KeyringControllerError.UnsupportedVerifySeedPhrase);
19021901
}

packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,9 +1983,7 @@ export class SeedlessOnboardingController<
19831983
#isAuthTokenError(error: unknown): boolean {
19841984
if (error instanceof TOPRFError) {
19851985
return (
1986-
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
19871986
error.code === TOPRFErrorCode.AuthTokenExpired ||
1988-
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
19891987
error.code === TOPRFErrorCode.InvalidAuthToken
19901988
);
19911989
}

0 commit comments

Comments
 (0)