mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
Update Eslint and deps (#15293)
This commit is contained in:
parent
b82d357a0d
commit
1db0ee87ec
@ -63,5 +63,21 @@ module.exports = {
|
||||
// a browser context. For instance, we may import polyfills which change
|
||||
// global variables, or we may import stylesheets.
|
||||
'import/no-unassigned-import': 'off',
|
||||
|
||||
// import/no-named-as-default-member checks if default imports also have
|
||||
// named exports matching properties used on the default import. Example:
|
||||
// in confirm-seed-phrase-component.test.js we import sinon from 'sinon'
|
||||
// and later access sinon.spy. spy is also exported from sinon directly and
|
||||
// thus triggers the error. Turning this rule off to prevent churn when
|
||||
// upgrading eslint and dependencies. This rule should be evaluated and
|
||||
// if agreeable turned on upstream in @metamask/eslint-config
|
||||
'import/no-named-as-default-member': 'off',
|
||||
|
||||
// This rule is set to off to avoid churn when upgrading eslint and its
|
||||
// dependencies. This rule should be enabled and the failures fixed in
|
||||
// a separate PR. This rule prevents adding file extensions to imports
|
||||
// of the same type. E.G, not adding the '.js' extension to file names when
|
||||
// inside a .js file.
|
||||
'import/extensions': 'off',
|
||||
},
|
||||
};
|
||||
|
14
.eslintrc.js
14
.eslintrc.js
@ -278,6 +278,20 @@ module.exports = {
|
||||
{ maxSize: 50, inlineMaxSize: 50 },
|
||||
],
|
||||
'jest/no-restricted-matchers': 'off',
|
||||
/**
|
||||
* jest/prefer-to-be is a new rule that was disabled to reduce churn
|
||||
* when upgrading eslint. It should be considered for use and enabled
|
||||
* in a future PR if agreeable.
|
||||
*/
|
||||
'jest/prefer-to-be': 'off',
|
||||
/**
|
||||
* jest/lowercase-name was renamed to jest/prefer-lowercase-title this
|
||||
* change was made to essentially retain the same state as the original
|
||||
* eslint-config-jest until it is updated. At which point the following
|
||||
* two lines can be deleted.
|
||||
*/
|
||||
'jest/lowercase-name': 'off',
|
||||
'jest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
|
||||
},
|
||||
},
|
||||
/**
|
||||
|
@ -14,6 +14,23 @@ module.exports = {
|
||||
'jsdoc/require-returns-type': 'off',
|
||||
'jsdoc/require-returns': 'off',
|
||||
'jsdoc/valid-types': 'off',
|
||||
// jsdoc/check-types now checks for mismatched casing of 'Object' types
|
||||
// which has a larger impact on typescript projects than javascript ones
|
||||
// due to the typescript Object type. To prevent large amounts of churn
|
||||
// these temporary overrides are added which will be removed and casing
|
||||
// normalized in a future PR.
|
||||
'jsdoc/check-types': [
|
||||
'error',
|
||||
{
|
||||
exemptTagContexts: [
|
||||
{ tag: 'property', types: ['Object', 'Object[]', 'Array<Object>'] },
|
||||
{ tag: 'param', types: ['Object', 'Object[]', 'Array<Object>'] },
|
||||
{ tag: 'typedef', types: ['Object', 'Object[]', 'Array<Object>'] },
|
||||
{ tag: 'returns', types: ['Object', 'Object[]', 'Array<Object>'] },
|
||||
{ tag: 'type', types: ['Object', 'Object[]', 'Array<Object>'] },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
jsdoc: {
|
||||
|
@ -2,7 +2,7 @@
|
||||
// eslint-disable-next-line import/unambiguous
|
||||
if (
|
||||
!(typeof process !== 'undefined' && process.env.METAMASK_DEBUG) &&
|
||||
typeof console !== undefined
|
||||
typeof console !== 'undefined'
|
||||
) {
|
||||
console.log = noop;
|
||||
console.info = noop;
|
||||
|
@ -16,7 +16,7 @@ export default class ComposableObservableStore extends ObservableStore {
|
||||
* extends one of the two base controllers in the `@metamask/controllers`
|
||||
* package.
|
||||
*
|
||||
* @type {Record<string, Object>}
|
||||
* @type {Record<string, object>}
|
||||
*/
|
||||
config = {};
|
||||
|
||||
@ -43,7 +43,7 @@ export default class ComposableObservableStore extends ObservableStore {
|
||||
/**
|
||||
* Composes a new internal store subscription structure
|
||||
*
|
||||
* @param {Record<string, Object>} config - Describes which stores are being
|
||||
* @param {Record<string, object>} config - Describes which stores are being
|
||||
* composed. The key is the name of the store, and the value is either an
|
||||
* ObserableStore, or a controller that extends one of the two base
|
||||
* controllers in the `@metamask/controllers` package.
|
||||
|
@ -31,7 +31,7 @@ const expectedHookNames = Array.from(
|
||||
*
|
||||
* @param {Record<string, unknown>} hooks - Required "hooks" into our
|
||||
* controllers.
|
||||
* @returns {(req: Object, res: Object, next: Function, end: Function) => void}
|
||||
* @returns {(req: object, res: object, next: Function, end: Function) => void}
|
||||
*/
|
||||
export function createMethodMiddleware(hooks) {
|
||||
// Fail immediately if we forgot to provide any expected hooks.
|
||||
|
@ -2227,7 +2227,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
* Collects all the information that we want to share
|
||||
* with the mobile client for syncing purposes
|
||||
*
|
||||
* @returns {Promise<Object>} Parts of the state that we want to syncx
|
||||
* @returns {Promise<object>} Parts of the state that we want to syncx
|
||||
*/
|
||||
async fetchInfoToSync() {
|
||||
// Preferences
|
||||
@ -2869,7 +2869,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
* Signifies user intent to complete an eth_sign method.
|
||||
*
|
||||
* @param {Object} msgParams - The params passed to eth_call.
|
||||
* @returns {Promise<Object>} Full state update.
|
||||
* @returns {Promise<object>} Full state update.
|
||||
*/
|
||||
async signMessage(msgParams) {
|
||||
log.info('MetaMaskController - signMessage');
|
||||
@ -2928,7 +2928,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
* Triggers signing, and the callback function from newUnsignedPersonalMessage.
|
||||
*
|
||||
* @param {Object} msgParams - The params of the message to sign & return to the Dapp.
|
||||
* @returns {Promise<Object>} A full state update.
|
||||
* @returns {Promise<object>} A full state update.
|
||||
*/
|
||||
async signPersonalMessage(msgParams) {
|
||||
log.info('MetaMaskController - signPersonalMessage');
|
||||
@ -2987,7 +2987,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
* Only decrypt message and don't touch transaction state
|
||||
*
|
||||
* @param {Object} msgParams - The params of the message to decrypt.
|
||||
* @returns {Promise<Object>} A full state update.
|
||||
* @returns {Promise<object>} A full state update.
|
||||
*/
|
||||
async decryptMessageInline(msgParams) {
|
||||
log.info('MetaMaskController - decryptMessageInline');
|
||||
@ -3013,7 +3013,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
* Triggers decrypt, and the callback function from newUnsignedDecryptMessage.
|
||||
*
|
||||
* @param {Object} msgParams - The params of the message to decrypt & return to the Dapp.
|
||||
* @returns {Promise<Object>} A full state update.
|
||||
* @returns {Promise<object>} A full state update.
|
||||
*/
|
||||
async decryptMessage(msgParams) {
|
||||
log.info('MetaMaskController - decryptMessage');
|
||||
@ -3114,7 +3114,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
* Triggers receiving, and the callback function from newUnsignedEncryptionPublicKey.
|
||||
*
|
||||
* @param {Object} msgParams - The params of the message to receive & return to the Dapp.
|
||||
* @returns {Promise<Object>} A full state update.
|
||||
* @returns {Promise<object>} A full state update.
|
||||
*/
|
||||
async encryptionPublicKey(msgParams) {
|
||||
log.info('MetaMaskController - encryptionPublicKey');
|
||||
|
@ -763,7 +763,7 @@ function setupBundlerDefaults(
|
||||
Object.assign(bundlerOpts, {
|
||||
// Source transforms
|
||||
transform: [
|
||||
// Remove code that should be excluded from builds of the current type
|
||||
// // Remove code that should be excluded from builds of the current type
|
||||
createRemoveFencedCodeTransform(buildType, shouldLintFenceFiles),
|
||||
// Transpile top-level code
|
||||
[
|
||||
|
@ -19,7 +19,7 @@ function defaultOnError(error) {
|
||||
/**
|
||||
* This function handles requests for the mock Segment server
|
||||
*
|
||||
* @typedef {(request: IncomingMessage, response: ServerResponse, metricEvents: Array<Object>) => void} MockSegmentRequestHandler
|
||||
* @typedef {(request: IncomingMessage, response: ServerResponse, metricEvents: Array<object>) => void} MockSegmentRequestHandler
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -18,6 +18,7 @@ function getLocalePath(code) {
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
async function getLocale(code) {
|
||||
try {
|
||||
const localeFilePath = getLocalePath(code);
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
const { promises: fs } = require('fs');
|
||||
const path = require('path');
|
||||
// Fetch is part of node js in future versions, thus triggering no-shadow
|
||||
// eslint-disable-next-line no-shadow
|
||||
const fetch = require('node-fetch');
|
||||
const glob = require('fast-glob');
|
||||
const VERSION = require('../package.json').version;
|
||||
|
@ -95,6 +95,7 @@ async function main() {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
async function writeLocale(code, locale) {
|
||||
try {
|
||||
const localeFilePath = getLocalePath(code);
|
||||
|
@ -2655,10 +2655,10 @@
|
||||
"@metamask/controllers>nanoid": true,
|
||||
"@metamask/controllers>web3-provider-engine": true,
|
||||
"@metamask/metamask-eth-abis": true,
|
||||
"@storybook/api>fast-deep-equal": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>events": true,
|
||||
"deep-freeze-strict": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"eth-json-rpc-infura": true,
|
||||
"eth-keyring-controller": true,
|
||||
@ -3234,7 +3234,7 @@
|
||||
},
|
||||
"@metamask/rpc-methods>@metamask/utils": {
|
||||
"packages": {
|
||||
"@storybook/api>fast-deep-equal": true
|
||||
"eslint>fast-deep-equal": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller": {
|
||||
@ -3303,9 +3303,9 @@
|
||||
"@metamask/snap-controllers>nanoid": true,
|
||||
"@metamask/snap-controllers>readable-web-to-node-stream": true,
|
||||
"@metamask/snap-controllers>tar-stream": true,
|
||||
"@storybook/api>fast-deep-equal": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>crypto-browserify": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-rpc-errors": true,
|
||||
"json-rpc-engine": true,
|
||||
"json-rpc-engine>@metamask/safe-event-emitter": true,
|
||||
@ -3402,7 +3402,7 @@
|
||||
},
|
||||
"@metamask/snap-controllers>ajv": {
|
||||
"packages": {
|
||||
"@storybook/api>fast-deep-equal": true
|
||||
"eslint>fast-deep-equal": true
|
||||
}
|
||||
},
|
||||
"@metamask/snap-controllers>concat-stream": {
|
||||
@ -4547,19 +4547,12 @@
|
||||
},
|
||||
"enzyme>is-regex": {
|
||||
"packages": {
|
||||
"string.prototype.matchall>call-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
"enzyme>is-regex>has-tostringtag": true,
|
||||
"string.prototype.matchall>call-bind": true
|
||||
}
|
||||
},
|
||||
"eslint-plugin-react>array-includes>get-intrinsic": {
|
||||
"globals": {
|
||||
"AggregateError": true,
|
||||
"FinalizationRegistry": true,
|
||||
"WeakRef": true
|
||||
},
|
||||
"enzyme>is-regex>has-tostringtag": {
|
||||
"packages": {
|
||||
"enzyme>has": true,
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
}
|
||||
},
|
||||
@ -5881,9 +5874,15 @@
|
||||
},
|
||||
"globalthis>define-properties": {
|
||||
"packages": {
|
||||
"globalthis>define-properties>has-property-descriptors": true,
|
||||
"nock>deep-equal>object-keys": true
|
||||
}
|
||||
},
|
||||
"globalthis>define-properties>has-property-descriptors": {
|
||||
"packages": {
|
||||
"string.prototype.matchall>get-intrinsic": true
|
||||
}
|
||||
},
|
||||
"json-rpc-engine": {
|
||||
"packages": {
|
||||
"eth-rpc-errors": true,
|
||||
@ -6002,6 +6001,11 @@
|
||||
"string.prototype.matchall>regexp.prototype.flags": true
|
||||
}
|
||||
},
|
||||
"nock>deep-equal>is-date-object": {
|
||||
"packages": {
|
||||
"enzyme>is-regex>has-tostringtag": true
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"globals": {
|
||||
"Headers": true,
|
||||
@ -6595,12 +6599,25 @@
|
||||
},
|
||||
"string.prototype.matchall>call-bind": {
|
||||
"packages": {
|
||||
"eslint-plugin-react>array-includes>get-intrinsic": true,
|
||||
"mocha>object.assign>function-bind": true
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>get-intrinsic": true
|
||||
}
|
||||
},
|
||||
"string.prototype.matchall>get-intrinsic": {
|
||||
"globals": {
|
||||
"AggregateError": true,
|
||||
"FinalizationRegistry": true,
|
||||
"WeakRef": true
|
||||
},
|
||||
"packages": {
|
||||
"enzyme>has": true,
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
}
|
||||
},
|
||||
"string.prototype.matchall>regexp.prototype.flags": {
|
||||
"packages": {
|
||||
"enzyme>function.prototype.name>functions-have-names": true,
|
||||
"globalthis>define-properties": true,
|
||||
"string.prototype.matchall>call-bind": true
|
||||
}
|
||||
|
@ -2655,10 +2655,10 @@
|
||||
"@metamask/controllers>nanoid": true,
|
||||
"@metamask/controllers>web3-provider-engine": true,
|
||||
"@metamask/metamask-eth-abis": true,
|
||||
"@storybook/api>fast-deep-equal": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>events": true,
|
||||
"deep-freeze-strict": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"eth-json-rpc-infura": true,
|
||||
"eth-keyring-controller": true,
|
||||
@ -3234,7 +3234,7 @@
|
||||
},
|
||||
"@metamask/rpc-methods>@metamask/utils": {
|
||||
"packages": {
|
||||
"@storybook/api>fast-deep-equal": true
|
||||
"eslint>fast-deep-equal": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller": {
|
||||
@ -3303,9 +3303,9 @@
|
||||
"@metamask/snap-controllers>nanoid": true,
|
||||
"@metamask/snap-controllers>readable-web-to-node-stream": true,
|
||||
"@metamask/snap-controllers>tar-stream": true,
|
||||
"@storybook/api>fast-deep-equal": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>crypto-browserify": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-rpc-errors": true,
|
||||
"json-rpc-engine": true,
|
||||
"json-rpc-engine>@metamask/safe-event-emitter": true,
|
||||
@ -3402,7 +3402,7 @@
|
||||
},
|
||||
"@metamask/snap-controllers>ajv": {
|
||||
"packages": {
|
||||
"@storybook/api>fast-deep-equal": true
|
||||
"eslint>fast-deep-equal": true
|
||||
}
|
||||
},
|
||||
"@metamask/snap-controllers>concat-stream": {
|
||||
@ -4547,19 +4547,12 @@
|
||||
},
|
||||
"enzyme>is-regex": {
|
||||
"packages": {
|
||||
"string.prototype.matchall>call-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
"enzyme>is-regex>has-tostringtag": true,
|
||||
"string.prototype.matchall>call-bind": true
|
||||
}
|
||||
},
|
||||
"eslint-plugin-react>array-includes>get-intrinsic": {
|
||||
"globals": {
|
||||
"AggregateError": true,
|
||||
"FinalizationRegistry": true,
|
||||
"WeakRef": true
|
||||
},
|
||||
"enzyme>is-regex>has-tostringtag": {
|
||||
"packages": {
|
||||
"enzyme>has": true,
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
}
|
||||
},
|
||||
@ -5881,9 +5874,15 @@
|
||||
},
|
||||
"globalthis>define-properties": {
|
||||
"packages": {
|
||||
"globalthis>define-properties>has-property-descriptors": true,
|
||||
"nock>deep-equal>object-keys": true
|
||||
}
|
||||
},
|
||||
"globalthis>define-properties>has-property-descriptors": {
|
||||
"packages": {
|
||||
"string.prototype.matchall>get-intrinsic": true
|
||||
}
|
||||
},
|
||||
"json-rpc-engine": {
|
||||
"packages": {
|
||||
"eth-rpc-errors": true,
|
||||
@ -6002,6 +6001,11 @@
|
||||
"string.prototype.matchall>regexp.prototype.flags": true
|
||||
}
|
||||
},
|
||||
"nock>deep-equal>is-date-object": {
|
||||
"packages": {
|
||||
"enzyme>is-regex>has-tostringtag": true
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"globals": {
|
||||
"Headers": true,
|
||||
@ -6595,12 +6599,25 @@
|
||||
},
|
||||
"string.prototype.matchall>call-bind": {
|
||||
"packages": {
|
||||
"eslint-plugin-react>array-includes>get-intrinsic": true,
|
||||
"mocha>object.assign>function-bind": true
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>get-intrinsic": true
|
||||
}
|
||||
},
|
||||
"string.prototype.matchall>get-intrinsic": {
|
||||
"globals": {
|
||||
"AggregateError": true,
|
||||
"FinalizationRegistry": true,
|
||||
"WeakRef": true
|
||||
},
|
||||
"packages": {
|
||||
"enzyme>has": true,
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
}
|
||||
},
|
||||
"string.prototype.matchall>regexp.prototype.flags": {
|
||||
"packages": {
|
||||
"enzyme>function.prototype.name>functions-have-names": true,
|
||||
"globalthis>define-properties": true,
|
||||
"string.prototype.matchall>call-bind": true
|
||||
}
|
||||
|
@ -2655,10 +2655,10 @@
|
||||
"@metamask/controllers>nanoid": true,
|
||||
"@metamask/controllers>web3-provider-engine": true,
|
||||
"@metamask/metamask-eth-abis": true,
|
||||
"@storybook/api>fast-deep-equal": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>events": true,
|
||||
"deep-freeze-strict": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"eth-json-rpc-infura": true,
|
||||
"eth-keyring-controller": true,
|
||||
@ -3234,7 +3234,7 @@
|
||||
},
|
||||
"@metamask/rpc-methods>@metamask/utils": {
|
||||
"packages": {
|
||||
"@storybook/api>fast-deep-equal": true
|
||||
"eslint>fast-deep-equal": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller": {
|
||||
@ -3303,9 +3303,9 @@
|
||||
"@metamask/snap-controllers>nanoid": true,
|
||||
"@metamask/snap-controllers>readable-web-to-node-stream": true,
|
||||
"@metamask/snap-controllers>tar-stream": true,
|
||||
"@storybook/api>fast-deep-equal": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>crypto-browserify": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-rpc-errors": true,
|
||||
"json-rpc-engine": true,
|
||||
"json-rpc-engine>@metamask/safe-event-emitter": true,
|
||||
@ -3402,7 +3402,7 @@
|
||||
},
|
||||
"@metamask/snap-controllers>ajv": {
|
||||
"packages": {
|
||||
"@storybook/api>fast-deep-equal": true
|
||||
"eslint>fast-deep-equal": true
|
||||
}
|
||||
},
|
||||
"@metamask/snap-controllers>concat-stream": {
|
||||
@ -4547,19 +4547,12 @@
|
||||
},
|
||||
"enzyme>is-regex": {
|
||||
"packages": {
|
||||
"string.prototype.matchall>call-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
"enzyme>is-regex>has-tostringtag": true,
|
||||
"string.prototype.matchall>call-bind": true
|
||||
}
|
||||
},
|
||||
"eslint-plugin-react>array-includes>get-intrinsic": {
|
||||
"globals": {
|
||||
"AggregateError": true,
|
||||
"FinalizationRegistry": true,
|
||||
"WeakRef": true
|
||||
},
|
||||
"enzyme>is-regex>has-tostringtag": {
|
||||
"packages": {
|
||||
"enzyme>has": true,
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
}
|
||||
},
|
||||
@ -5881,9 +5874,15 @@
|
||||
},
|
||||
"globalthis>define-properties": {
|
||||
"packages": {
|
||||
"globalthis>define-properties>has-property-descriptors": true,
|
||||
"nock>deep-equal>object-keys": true
|
||||
}
|
||||
},
|
||||
"globalthis>define-properties>has-property-descriptors": {
|
||||
"packages": {
|
||||
"string.prototype.matchall>get-intrinsic": true
|
||||
}
|
||||
},
|
||||
"json-rpc-engine": {
|
||||
"packages": {
|
||||
"eth-rpc-errors": true,
|
||||
@ -6002,6 +6001,11 @@
|
||||
"string.prototype.matchall>regexp.prototype.flags": true
|
||||
}
|
||||
},
|
||||
"nock>deep-equal>is-date-object": {
|
||||
"packages": {
|
||||
"enzyme>is-regex>has-tostringtag": true
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"globals": {
|
||||
"Headers": true,
|
||||
@ -6595,12 +6599,25 @@
|
||||
},
|
||||
"string.prototype.matchall>call-bind": {
|
||||
"packages": {
|
||||
"eslint-plugin-react>array-includes>get-intrinsic": true,
|
||||
"mocha>object.assign>function-bind": true
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>get-intrinsic": true
|
||||
}
|
||||
},
|
||||
"string.prototype.matchall>get-intrinsic": {
|
||||
"globals": {
|
||||
"AggregateError": true,
|
||||
"FinalizationRegistry": true,
|
||||
"WeakRef": true
|
||||
},
|
||||
"packages": {
|
||||
"enzyme>has": true,
|
||||
"mocha>object.assign>function-bind": true,
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
}
|
||||
},
|
||||
"string.prototype.matchall>regexp.prototype.flags": {
|
||||
"packages": {
|
||||
"enzyme>function.prototype.name>functions-have-names": true,
|
||||
"globalthis>define-properties": true,
|
||||
"string.prototype.matchall>call-bind": true
|
||||
}
|
||||
|
@ -14,6 +14,18 @@
|
||||
}
|
||||
},
|
||||
"eslint>@eslint/eslintrc": {
|
||||
"builtin": {
|
||||
"assert": true,
|
||||
"fs": true,
|
||||
"module": true,
|
||||
"os": true,
|
||||
"path": true,
|
||||
"url": true,
|
||||
"util": true
|
||||
},
|
||||
"globals": {
|
||||
"process.platform": true
|
||||
},
|
||||
"packages": {
|
||||
"$root$": true,
|
||||
"@babel/eslint-parser": true,
|
||||
@ -32,22 +44,49 @@
|
||||
"eslint-plugin-react-hooks": true
|
||||
}
|
||||
},
|
||||
"eslint>eslint-scope": {
|
||||
"builtin": {
|
||||
"assert": true
|
||||
}
|
||||
},
|
||||
"eslint-plugin-jest": {
|
||||
"packages": {
|
||||
"eslint-plugin-jest>@typescript-eslint/experimental-utils": true,
|
||||
"eslint-plugin-jest>@typescript-eslint/utils": true,
|
||||
"@typescript-eslint/eslint-plugin": true
|
||||
}
|
||||
},
|
||||
"eslint-plugin-jest>@typescript-eslint/utils>eslint-utils": {
|
||||
"packages": {
|
||||
"eslint-plugin-jest>@typescript-eslint/utils>eslint-utils>eslint-visitor-keys": true
|
||||
}
|
||||
},
|
||||
"eslint-plugin-jest>@typescript-eslint/utils": {
|
||||
"builtin": {
|
||||
"path": true
|
||||
},
|
||||
"packages": {
|
||||
"eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true,
|
||||
"eslint-plugin-jest>@typescript-eslint/utils>eslint-utils": true,
|
||||
"@typescript-eslint/parser>@typescript-eslint/types": true,
|
||||
"eslint": true,
|
||||
"@typescript-eslint/parser>@typescript-eslint/scope-manager": true,
|
||||
"eslint>eslint-scope": true,
|
||||
"@babel/eslint-parser>eslint-scope": true,
|
||||
"eslint>eslint-utils": true
|
||||
}
|
||||
},
|
||||
"eslint-plugin-jest>@typescript-eslint/experimental-utils": {
|
||||
"builtin": {
|
||||
"path": true
|
||||
},
|
||||
"packages": {
|
||||
"eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true,
|
||||
"eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": true,
|
||||
"@typescript-eslint/parser>@typescript-eslint/types": true,
|
||||
"eslint": true,
|
||||
"@typescript-eslint/parser>@typescript-eslint/scope-manager": true,
|
||||
"eslint>eslint-scope": true
|
||||
"eslint>eslint-scope": true,
|
||||
"eslint>eslint-utils": true
|
||||
}
|
||||
},
|
||||
"eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": {
|
||||
@ -55,10 +94,29 @@
|
||||
"eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils>eslint-visitor-keys": true
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils": {
|
||||
"packages": {
|
||||
"eslint>debug": true,
|
||||
"@typescript-eslint/eslint-plugin>tsutils": true,
|
||||
"typescript": true,
|
||||
"eslint-plugin-jest>@typescript-eslint/utils": true,
|
||||
"@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug": true
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug": {
|
||||
"packages": {
|
||||
"@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils>debug>ms": true
|
||||
},
|
||||
"globals": {
|
||||
"console.debug": true,
|
||||
"console.log": true
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"packages": {
|
||||
"typescript": true,
|
||||
"eslint-plugin-jest>@typescript-eslint/experimental-utils": true,
|
||||
"eslint-plugin-jest>@typescript-eslint/utils": true,
|
||||
"@typescript-eslint/eslint-plugin>@typescript-eslint/type-utils": true,
|
||||
"@typescript-eslint/parser>@typescript-eslint/scope-manager": true,
|
||||
"@typescript-eslint/eslint-plugin>tsutils": true,
|
||||
"eslint>debug": true,
|
||||
@ -91,6 +149,11 @@
|
||||
"Buffer": true
|
||||
}
|
||||
},
|
||||
"string.prototype.matchall>get-intrinsic": {
|
||||
"packages": {
|
||||
"string.prototype.matchall>has-symbols": true
|
||||
}
|
||||
},
|
||||
"tsutils": {
|
||||
"packages": {
|
||||
"typescript": true,
|
||||
|
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -76,6 +76,7 @@
|
||||
"lavamoat:auto": "yarn lavamoat:build:auto && yarn lavamoat:background:auto"
|
||||
},
|
||||
"resolutions": {
|
||||
"acorn": "^7.4.1",
|
||||
"**/regenerator-runtime": "^0.13.7",
|
||||
"**/caniuse-lite": "1.0.30001265",
|
||||
"**/cross-fetch": "^3.1.5",
|
||||
@ -274,8 +275,8 @@
|
||||
"@testing-library/user-event": "^14.0.0-beta.12",
|
||||
"@tsconfig/node14": "^1.0.1",
|
||||
"@types/react": "^16.9.53",
|
||||
"@typescript-eslint/eslint-plugin": "^4.20.0",
|
||||
"@typescript-eslint/parser": "^4.20.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
||||
"@typescript-eslint/parser": "^5.30.7",
|
||||
"addons-linter": "^5.2.0",
|
||||
"babelify": "^10.0.0",
|
||||
"bify-module-groups": "^2.0.0",
|
||||
@ -295,13 +296,13 @@
|
||||
"duplexify": "^4.1.1",
|
||||
"enzyme": "^3.10.0",
|
||||
"enzyme-adapter-react-16": "^1.15.1",
|
||||
"eslint": "^7.23.0",
|
||||
"eslint": "^8.20.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-import-resolver-node": "^0.3.4",
|
||||
"eslint-import-resolver-typescript": "^2.5.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-jest": "^24.3.4",
|
||||
"eslint-plugin-jsdoc": "^37.0.3",
|
||||
"eslint-plugin-jest": "^26.6.0",
|
||||
"eslint-plugin-jsdoc": "^39.3.3",
|
||||
"eslint-plugin-mocha": "^8.1.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
|
@ -1,21 +0,0 @@
|
||||
diff --git a/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/node_modules/@eslint/eslintrc/lib/config-array-factory.js
|
||||
index c7ff6a0..6a88c6d 100644
|
||||
--- a/node_modules/@eslint/eslintrc/lib/config-array-factory.js
|
||||
+++ b/node_modules/@eslint/eslintrc/lib/config-array-factory.js
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
-const importFresh = require("import-fresh");
|
||||
const stripComments = require("strip-json-comments");
|
||||
const ConfigValidator = require("./shared/config-validator");
|
||||
const naming = require("./shared/naming");
|
||||
@@ -222,7 +221,7 @@ function loadLegacyConfigFile(filePath) {
|
||||
function loadJSConfigFile(filePath) {
|
||||
debug(`Loading JS config file: ${filePath}`);
|
||||
try {
|
||||
- return importFresh(filePath);
|
||||
+ return require(filePath);
|
||||
} catch (e) {
|
||||
debug(`Error reading JavaScript file: ${filePath}`);
|
||||
e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
|
59
patches/@eslint+eslintrc+1.3.0.patch
Normal file
59
patches/@eslint+eslintrc+1.3.0.patch
Normal file
File diff suppressed because one or more lines are too long
@ -1,8 +1,8 @@
|
||||
diff --git a/node_modules/eslint/lib/linter/linter.js b/node_modules/eslint/lib/linter/linter.js
|
||||
index adb5c21..4a4be92 100644
|
||||
index 29d78da..a6ae07b 100644
|
||||
--- a/node_modules/eslint/lib/linter/linter.js
|
||||
+++ b/node_modules/eslint/lib/linter/linter.js
|
||||
@@ -560,7 +560,7 @@ function resolveParserOptions(parserName, providedOptions, enabledEnvironments)
|
||||
@@ -704,7 +704,7 @@ function createLanguageOptions({ globals: configuredGlobals, parser, parserOptio
|
||||
*/
|
||||
function resolveGlobals(providedGlobals, enabledEnvironments) {
|
||||
return Object.assign(
|
@ -262,7 +262,7 @@ export const METAMETRICS_BACKGROUND_PAGE_OBJECT = {
|
||||
* callback: (err?: Error) => void
|
||||
* ) => void} track - Track an event with Segment, using the internal batching
|
||||
* mechanism to optimize network requests
|
||||
* @property {(payload: Object) => void} page - Track a page view with Segment
|
||||
* @property {(payload: object) => void} page - Track a page view with Segment
|
||||
* @property {() => void} identify - Identify an anonymous user. We do not
|
||||
* currently use this method.
|
||||
*/
|
||||
|
@ -8,7 +8,7 @@
|
||||
* masked according to that sub-mask.
|
||||
*
|
||||
* @param {Object} object - The object to mask
|
||||
* @param {Object<Object|boolean>} mask - The mask to apply to the object
|
||||
* @param {Object<object | boolean>} mask - The mask to apply to the object
|
||||
*/
|
||||
export function maskObject(object, mask) {
|
||||
return Object.keys(object).reduce((state, key) => {
|
||||
|
@ -61,6 +61,8 @@ popoverContent.setAttribute('id', 'popover-content');
|
||||
window.document.body.appendChild(popoverContent);
|
||||
|
||||
// fetch
|
||||
// fetch is part of node js in future versions, thus triggering no-shadow
|
||||
// eslint-disable-next-line no-shadow
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
const { Headers, Request, Response } = fetch;
|
||||
|
@ -137,8 +137,8 @@ const COLLECTIBLES_CONTRACTS = [
|
||||
];
|
||||
|
||||
const collectiblesDropdownState = {
|
||||
0x495f947276749ce646f68ac8c248420045cb7b5e: true,
|
||||
0xdc7382eb0bc9c352a4cba23c909bda01e0206414: true,
|
||||
'0x495f947276749ce646f68ac8c248420045cb7b5e': true,
|
||||
'0xdc7382eb0bc9c352a4cba23c909bda01e0206414': true,
|
||||
};
|
||||
|
||||
const ACCOUNT_1 = '0x123';
|
||||
|
@ -33,7 +33,7 @@ describe('DetectedTokenDetails', () => {
|
||||
},
|
||||
handleTokenSelection: jest.fn(),
|
||||
tokensListDetected: {
|
||||
0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f: {
|
||||
'0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': {
|
||||
token: {
|
||||
name: 'Synthetix Network',
|
||||
address: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f',
|
||||
@ -58,7 +58,7 @@ describe('DetectedTokenDetails', () => {
|
||||
},
|
||||
selected: true,
|
||||
},
|
||||
0x514910771af9ca656af840dff83e8264ecf986ca: {
|
||||
'0x514910771af9ca656af840dff83e8264ecf986ca': {
|
||||
token: {
|
||||
name: 'ChainLink Token',
|
||||
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
|
||||
|
@ -54,11 +54,14 @@ export default function HoldToRevealButton({ buttonText, onLongPressed }) {
|
||||
*
|
||||
* @param e - Native animation event - React.AnimationEvent<HTMLDivElement>
|
||||
*/
|
||||
const triggerOnLongPressed = (e) => {
|
||||
onLongPressed();
|
||||
setHasTriggeredUnlock(true);
|
||||
preventPropogation(e);
|
||||
};
|
||||
const triggerOnLongPressed = useCallback(
|
||||
(e) => {
|
||||
onLongPressed();
|
||||
setHasTriggeredUnlock(true);
|
||||
preventPropogation(e);
|
||||
},
|
||||
[onLongPressed],
|
||||
);
|
||||
|
||||
/**
|
||||
* 3. Reset animation states
|
||||
|
@ -402,7 +402,7 @@ export function getSeedPhraseBackedUp(state) {
|
||||
*
|
||||
* @param {Object} state - the redux state object
|
||||
* @param {string} address - the address to search for among the keyring addresses
|
||||
* @returns {Object|undefined} The keyring which contains the passed address, or undefined
|
||||
* @returns {object | undefined} The keyring which contains the passed address, or undefined
|
||||
*/
|
||||
export function findKeyringForAddress(state, address) {
|
||||
const keyring = state.metamask.keyrings.find((kr) => {
|
||||
|
@ -408,7 +408,7 @@ export const draftTransactionInitialState = {
|
||||
* clean up AND during initialization. When a transaction is edited a new UUID
|
||||
* is generated for it and the state of that transaction is copied into a new
|
||||
* entry in the draftTransactions object.
|
||||
* @property {Object.<string, DraftTransaction>} draftTransactions - An object keyed
|
||||
* @property {Object<string, DraftTransaction>} draftTransactions - An object keyed
|
||||
* by UUID with draftTransactions as the values.
|
||||
* @property {boolean} eip1559support - tracks whether the current network
|
||||
* supports EIP 1559 transactions.
|
||||
|
@ -1241,7 +1241,7 @@ describe('Send Slice', () => {
|
||||
},
|
||||
useTokenDetection: true,
|
||||
tokenList: {
|
||||
0x514910771af9ca656af840dff83e8264ecf986ca: {
|
||||
'0x514910771af9ca656af840dff83e8264ecf986ca': {
|
||||
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
|
||||
symbol: 'LINK',
|
||||
decimals: 18,
|
||||
@ -1990,7 +1990,7 @@ describe('Send Slice', () => {
|
||||
tokens: [],
|
||||
useTokenDetection: true,
|
||||
tokenList: {
|
||||
0x514910771af9ca656af840dff83e8264ecf986ca: {
|
||||
'0x514910771af9ca656af840dff83e8264ecf986ca': {
|
||||
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
|
||||
symbol: 'LINK',
|
||||
decimals: 18,
|
||||
|
@ -39,11 +39,8 @@ export const useTransactionFunctions = ({
|
||||
) {
|
||||
return {};
|
||||
}
|
||||
const {
|
||||
maxFeePerGas,
|
||||
maxPriorityFeePerGas,
|
||||
gasLimit,
|
||||
} = transaction?.txParams;
|
||||
const { maxFeePerGas, maxPriorityFeePerGas, gasLimit } =
|
||||
transaction?.txParams ?? {};
|
||||
return {
|
||||
previousGas: {
|
||||
maxFeePerGas,
|
||||
@ -173,10 +170,8 @@ export const useTransactionFunctions = ({
|
||||
);
|
||||
|
||||
const updateTransactionUsingDAPPSuggestedValues = useCallback(() => {
|
||||
const {
|
||||
maxFeePerGas,
|
||||
maxPriorityFeePerGas,
|
||||
} = transaction?.dappSuggestedGasFees;
|
||||
const { maxFeePerGas, maxPriorityFeePerGas } =
|
||||
transaction?.dappSuggestedGasFees ?? {};
|
||||
updateTransaction({
|
||||
estimateUsed: PRIORITY_LEVELS.DAPP_SUGGESTED,
|
||||
maxFeePerGas,
|
||||
|
@ -70,7 +70,7 @@ const alertStateReducer = produce((state, action) => {
|
||||
*
|
||||
* @param {Object} pendingConfirmation - a pending confirmation waiting for
|
||||
* user approval
|
||||
* @returns {[alertState: Object, dismissAlert: Function]} A tuple with
|
||||
* @returns {[alertState: object, dismissAlert: Function]} A tuple with
|
||||
* the current alert state and function to dismiss an alert by id
|
||||
*/
|
||||
function useAlertState(pendingConfirmation) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
export default function SwapStepIcon({ stepNumber = 1 }) {
|
||||
switch (stepNumber) {
|
||||
@ -50,3 +51,7 @@ export default function SwapStepIcon({ stepNumber = 1 }) {
|
||||
return undefined; // Don't return any SVG if a step number is not supported.
|
||||
}
|
||||
}
|
||||
|
||||
SwapStepIcon.propTypes = {
|
||||
stepNumber: PropTypes.number,
|
||||
};
|
||||
|
@ -153,19 +153,19 @@ describe('selectors', () => {
|
||||
chainId: KOVAN_CHAIN_ID,
|
||||
},
|
||||
accounts: {
|
||||
0x7250739de134d33ec7ab1ee592711e15098c9d2d: {
|
||||
'0x7250739de134d33ec7ab1ee592711e15098c9d2d': {
|
||||
address: '0x7250739de134d33ec7ab1ee592711e15098c9d2d',
|
||||
},
|
||||
0x8e5d75d60224ea0c33d0041e75de68b1c3cb6dd5: {
|
||||
'0x8e5d75d60224ea0c33d0041e75de68b1c3cb6dd5': {
|
||||
address: '0x8e5d75d60224ea0c33d0041e75de68b1c3cb6dd5',
|
||||
},
|
||||
0xb3958fb96c8201486ae20be1d5c9f58083df343a: {
|
||||
'0xb3958fb96c8201486ae20be1d5c9f58083df343a': {
|
||||
address: '0xb3958fb96c8201486ae20be1d5c9f58083df343a',
|
||||
},
|
||||
0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc: {
|
||||
'0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc': {
|
||||
address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
|
||||
},
|
||||
0x617b3f8050a0bd94b6b1da02b4384ee5b4df13f4: {
|
||||
'0x617b3f8050a0bd94b6b1da02b4384ee5b4df13f4': {
|
||||
address: '0x617b3f8050a0bd94b6b1da02b4384ee5b4df13f4',
|
||||
},
|
||||
},
|
||||
@ -267,29 +267,34 @@ describe('selectors', () => {
|
||||
expect(getOrderedConnectedAccountsForActiveTab(mockState)).toStrictEqual([
|
||||
{
|
||||
address: '0xb3958fb96c8201486ae20be1d5c9f58083df343a',
|
||||
balance: undefined,
|
||||
name: 'Account 2',
|
||||
lastActive: 1586359844192,
|
||||
lastSelected: 1586359844193,
|
||||
},
|
||||
{
|
||||
address: '0x8e5d75d60224ea0c33d0041e75de68b1c3cb6dd5',
|
||||
balance: undefined,
|
||||
name: 'Account 1',
|
||||
lastActive: 1586359844192,
|
||||
lastSelected: 1586359844192,
|
||||
},
|
||||
{
|
||||
address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
|
||||
balance: undefined,
|
||||
name: 'Account 3',
|
||||
lastActive: 1586359844192,
|
||||
lastSelected: 1586359844192,
|
||||
},
|
||||
{
|
||||
address: '0x7250739de134d33ec7ab1ee592711e15098c9d2d',
|
||||
balance: undefined,
|
||||
name: 'Really Long Name That Should Be Truncated',
|
||||
lastActive: 1586359844192,
|
||||
},
|
||||
{
|
||||
address: '0x617b3f8050a0bd94b6b1da02b4384ee5b4df13f4',
|
||||
balance: undefined,
|
||||
name: 'Account 4',
|
||||
lastActive: 1586359844192,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user