Skip to content

Commit 3beb27a

Browse files
committed
fix: disable some eslint rule globally
1 parent 4c70cde commit 3beb27a

7 files changed

Lines changed: 22 additions & 12 deletions

File tree

.eslintrc.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ module.exports = {
5858
rules: {
5959
// Enable rules that are disabled in `@metamask/eslint-config-typescript`
6060
'@typescript-eslint/no-explicit-any': 'error',
61+
62+
// This rule triggers false positives and doesn't add real type-safety value.
63+
// See: https://typescript-eslint.io/rules/no-redundant-type-constituents/#when-not-to-use-it
64+
'@typescript-eslint/no-redundant-type-constituents': 'off',
6165
},
6266
},
6367
{
@@ -97,6 +101,10 @@ module.exports = {
97101
// works on the original repository, so there might be some side-effects now that
98102
// we are building in a monorepo)
99103
'@typescript-eslint/restrict-template-expressions': 'off',
104+
105+
// This rule triggers false positives and doesn't add real type-safety value.
106+
// See: https://typescript-eslint.io/rules/no-redundant-type-constituents/#when-not-to-use-it
107+
'@typescript-eslint/no-redundant-type-constituents': 'off',
100108
},
101109
},
102110
// @metamask/keyring-eth-hd
@@ -175,6 +183,10 @@ module.exports = {
175183
'jsdoc/tag-lines': 'off',
176184
'n/no-callback-literal': 'off',
177185
'promise/no-multiple-resolved': 'off',
186+
187+
// This rule triggers false positives and doesn't add real type-safety value.
188+
// See: https://typescript-eslint.io/rules/no-redundant-type-constituents/#when-not-to-use-it
189+
'@typescript-eslint/no-redundant-type-constituents': 'off',
178190
},
179191
},
180192
// @metamask/keyring-snap-bridge
@@ -189,6 +201,10 @@ module.exports = {
189201
// works on the original repository, so there might be some side-effects now that
190202
// we are building in a monorepo)
191203
'@typescript-eslint/restrict-template-expressions': 'off',
204+
205+
// This rule triggers false positives and doesn't add real type-safety value.
206+
// See: https://typescript-eslint.io/rules/no-redundant-type-constituents/#when-not-to-use-it
207+
'@typescript-eslint/no-redundant-type-constituents': 'off',
192208
},
193209
},
194210
// @metamask/keyring-snap-sdk
@@ -215,6 +231,10 @@ module.exports = {
215231
// works on the original repository, so there might be some side-effects now that
216232
// we are building in a monorepo)
217233
'@typescript-eslint/restrict-template-expressions': 'off',
234+
235+
// This rule triggers false positives and doesn't add real type-safety value.
236+
// See: https://typescript-eslint.io/rules/no-redundant-type-constituents/#when-not-to-use-it
237+
'@typescript-eslint/no-redundant-type-constituents': 'off',
218238
},
219239
},
220240
],

packages/keyring-eth-trezor/src/trezor-keyring-v2.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ const DERIVATION_PATH_PATTERN = /^(m\/44'\/(?:60'|1')(?:\/\d+'?)*)\/(\d+)$/u;
8989
export type TrezorKeyringV2Options = {
9090
legacyKeyring: TrezorKeyring;
9191
entropySource: EntropySourceId;
92-
// FIXME: eslint is complaning about `Trezor` and `OneKey` being `any`, so disable this for now:
93-
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
9492
type?: KeyringType.Trezor | KeyringType.OneKey;
9593
};
9694

packages/keyring-internal-api/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// FIXME: eslint is complaning about some unions here, so disable this for now:
1+
// FIXME: eslint is complaning about our account union even if those accounts
2+
// types should all be different, so we disable this for now:
23
/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
3-
/* eslint-disable @typescript-eslint/no-redundant-type-constituents */
44

55
import {
66
BtcAccountType,

packages/keyring-snap-bridge/src/SnapKeyring.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,6 @@ export class SnapKeyring {
914914
snapId: SnapId,
915915
scope: CaipChainId,
916916
request: JsonRpcRequest,
917-
// FIXME: eslint is complaning about `ResolvedAccountAddress` being `any`, so disable this for now:
918-
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
919917
): Promise<ResolvedAccountAddress | null> {
920918
// We do check that the incoming Snap ID is known by the keyring.
921919
if (!this.hasSnapId(snapId)) {

packages/keyring-snap-bridge/src/account.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ export function assertKeyringAccount<
9191
* @returns A valid transformed `KeyringAccount`.
9292
*/
9393
export function transformAccount(
94-
// FIXME: eslint is complaning about `Infer` (from `KeyringAccount`) being `any`, so disable this for now:
95-
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
9694
accountToTransform: KeyringAccountV1 | KeyringAccount,
9795
): KeyringAccount {
9896
// To keep the retro-compatibility with older keyring-api versions, we identify the account's

packages/keyring-snap-bridge/src/migrations/v1.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import {
2525
* @returns True if the account is v1, false otherwise.
2626
*/
2727
export function isAccountV1(
28-
// FIXME: eslint is complaning about `Infer` (used for `KeyringAccount`) being `any`, so disable this for now:
29-
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
3028
account: KeyringAccountV1 | KeyringAccount,
3129
): boolean {
3230
return is(account, KeyringAccountV1Struct);

packages/keyring-snap-client/src/KeyringClient.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ export class KeyringClient implements Keyring {
157157
async resolveAccountAddress(
158158
scope: CaipChainId,
159159
request: JsonRpcRequest,
160-
// FIXME: eslint is complaning about `ResolvedAccountAddress` being `any`, so disable this for now:
161-
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
162160
): Promise<ResolvedAccountAddress | null> {
163161
return strictMask(
164162
await this.send({

0 commit comments

Comments
 (0)