diff --git a/.babelrc.json b/.babelrc.json index d3f2c177d..3c43a0167 100644 --- a/.babelrc.json +++ b/.babelrc.json @@ -8,7 +8,12 @@ } } ], - "@babel/preset-react", + [ + "@babel/preset-react", + { + "runtime": "automatic" + } + ], "@babel/preset-typescript" ], "plugins": [ diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 9429ce196..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "rules": { - "multiline-ternary": 0, - "react/no-direct-mutation-state": 0, - "react/no-find-dom-node": 0 - } -} diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 203df840b..98af8a235 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,3 +1,4 @@ { - "**/*.{yml,json,md,html,ts,js}": "prettier --check" + "**/*.{yml,json,md,html,ts,js}": "prettier --check", + "**/*.{ts,tsx,js,jsx}": "eslint --quiet --fix" } diff --git a/@types/frame/index.d.ts b/@types/frame/index.d.ts index bc702cd64..b27f8d938 100644 --- a/@types/frame/index.d.ts +++ b/@types/frame/index.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/triple-slash-reference */ /// /// /// diff --git a/@types/frame/state.d.ts b/@types/frame/state.d.ts index 3b93cdcea..762fd431d 100644 --- a/@types/frame/state.d.ts +++ b/@types/frame/state.d.ts @@ -86,11 +86,6 @@ interface GasLevels { type HexAmount = string -enum Colorway { - light = 'light', - dark = 'dark' -} - type Color = { r: number; g: number; b: number } type ColorwayPalette = { accent1: Color diff --git a/app/dapp/index.js b/app/dapp/index.js index 2060366ee..faa0bba24 100644 --- a/app/dapp/index.js +++ b/app/dapp/index.js @@ -1,5 +1,4 @@ import * as Sentry from '@sentry/electron' -import React from 'react' import { createRoot } from 'react-dom/client' import Restore from 'react-restore' @@ -16,7 +15,7 @@ document.addEventListener('drop', (e) => e.preventDefault()) if (process.env.NODE_ENV !== 'development') { window.eval = global.eval = () => { throw new Error(`This app does not support window.eval()`) - } // eslint-disable-line + } } function AppComponent() { diff --git a/app/dash/Accounts/Add/index.js b/app/dash/Accounts/Add/index.js index 5a44f3ddc..39463604c 100644 --- a/app/dash/Accounts/Add/index.js +++ b/app/dash/Accounts/Add/index.js @@ -1,5 +1,3 @@ -/* globals Worker */ - import React from 'react' import Restore from 'react-restore' import { Transition } from 'react-transition-group' diff --git a/app/dash/Accounts/Add/particleWorker.js b/app/dash/Accounts/Add/particleWorker.js index ab279d73a..dfa6e818c 100644 --- a/app/dash/Accounts/Add/particleWorker.js +++ b/app/dash/Accounts/Add/particleWorker.js @@ -1,5 +1,3 @@ -/* globals self */ - let canvas, ctx, looper const particles = [] const particleCount = 56 diff --git a/app/dash/Signer/index.js b/app/dash/Signer/index.js index e054e7df3..eaa348a48 100644 --- a/app/dash/Signer/index.js +++ b/app/dash/Signer/index.js @@ -495,7 +495,7 @@ class Signer extends React.Component { <> )}
- {!!permissionId ? ( + {permissionId ? (
{'PERMISSION ID:'}
{permissionId}
diff --git a/app/dash/index.js b/app/dash/index.js index 797158f5b..604f95ff4 100644 --- a/app/dash/index.js +++ b/app/dash/index.js @@ -1,5 +1,4 @@ import * as Sentry from '@sentry/electron' -import React from 'react' import { createRoot } from 'react-dom/client' import Restore from 'react-restore' @@ -16,7 +15,7 @@ document.addEventListener('drop', (e) => e.preventDefault()) if (process.env.NODE_ENV !== 'development') { window.eval = global.eval = () => { throw new Error(`This app does not support window.eval()`) - } // eslint-disable-line + } } function AppComponent() { diff --git a/app/onboard/index.js b/app/onboard/index.js index 93a1ea5b1..cf0d7ca39 100644 --- a/app/onboard/index.js +++ b/app/onboard/index.js @@ -1,5 +1,4 @@ import * as Sentry from '@sentry/electron' -import React from 'react' import { createRoot } from 'react-dom/client' import Restore from 'react-restore' @@ -16,7 +15,7 @@ document.addEventListener('drop', (e) => e.preventDefault()) if (process.env.NODE_ENV !== 'development') { window.eval = global.eval = () => { throw new Error(`This app does not support window.eval()`) - } // eslint-disable-line + } } function AppComponent() { diff --git a/app/store.js b/app/store.js index 6a8229c48..c9f1fa80e 100644 --- a/app/store.js +++ b/app/store.js @@ -1,5 +1,3 @@ -/* globals */ - import EventEmitter from 'events' import Restore from 'react-restore' diff --git a/app/tray/Account/Balances/index.js b/app/tray/Account/Balances/index.js index 481377fcb..df1842d80 100644 --- a/app/tray/Account/Balances/index.js +++ b/app/tray/Account/Balances/index.js @@ -1,5 +1,3 @@ -/* globals ResizeObserver */ - import React from 'react' import Restore from 'react-restore' diff --git a/app/tray/Account/Signer/SignerPreview/index.js b/app/tray/Account/Signer/SignerPreview/index.js index 35271ff62..d05295a8d 100644 --- a/app/tray/Account/Signer/SignerPreview/index.js +++ b/app/tray/Account/Signer/SignerPreview/index.js @@ -168,7 +168,7 @@ class Signer extends React.Component { this.setState({ notifySuccess: false, notifyText: '' }) }, 5000) } - const crumb = !!signer ? signerPanelCrumb(signer) : accountPanelCrumb() + const crumb = signer ? signerPanelCrumb(signer) : accountPanelCrumb() link.send('tray:action', 'navDash', crumb) }} > diff --git a/app/tray/Footer/RequestCommand/index.js b/app/tray/Footer/RequestCommand/index.js index e84a9d2a8..e51be5793 100644 --- a/app/tray/Footer/RequestCommand/index.js +++ b/app/tray/Footer/RequestCommand/index.js @@ -328,7 +328,7 @@ class RequestCommand extends React.Component { const showWarning = !status && mode !== 'monitor' const requiredApproval = showWarning && (req.approvals || []).filter((a) => !a.approved)[0] - if (!!requiredApproval) { + if (requiredApproval) { return (
diff --git a/app/tray/index.js b/app/tray/index.js index 15b1f6af5..04c418a3b 100644 --- a/app/tray/index.js +++ b/app/tray/index.js @@ -1,5 +1,4 @@ import * as Sentry from '@sentry/electron' -import React from 'react' import { createRoot } from 'react-dom/client' import Restore from 'react-restore' @@ -16,7 +15,7 @@ document.addEventListener('drop', (e) => e.preventDefault()) if (process.env.NODE_ENV !== 'development') { window.eval = global.eval = () => { throw new Error(`This app does not support window.eval()`) - } // eslint-disable-line + } } function AppComponent() { diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..cce079a85 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,162 @@ +import ts from '@typescript-eslint/eslint-plugin' +import tsParser from '@typescript-eslint/parser' +import prettier from 'eslint-config-prettier' +import react from 'eslint-plugin-react' +import reactHooks from 'eslint-plugin-react-hooks' +import testingLibrary from 'eslint-plugin-testing-library' +import jest from 'eslint-plugin-jest' +import globals from 'globals' + +export default [ + 'eslint:recommended', + // Ignored dirs + { + ignores: ['dist/**/*', 'compiled/**/*', 'bundle/**/*'] + }, + // Temporary ignored dirs - TODO: remove on rewrite + { + ignores: ['main/signers/**/*'] + }, + // All files + { + files: ['**/*.{js,mjs,ts,tsx}'], + languageOptions: { + ecmaVersion: 'latest', + globals: { + ...globals.es2021 + } + }, + rules: { + ...prettier.rules, + 'no-unused-vars': [ + 'error', + { + args: 'after-used', + ignoreRestSiblings: true, + argsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_' + } + ] + } + }, + // Main process files and scripts + { + files: ['**/*.{js,mjs,ts}'], + ignores: ['app/**/*', 'resources/Components/**/*'], + languageOptions: { + globals: { + ...globals.node + } + } + }, + // Renderer process files + { + files: [ + 'app/**/*.js', + 'main/dapps/server/inject/*.js', + 'resources/**/*.{js,ts,tsx}', + 'test/app/**/*.js', + 'test/resources/Components/**/*.js' + ], + languageOptions: { + globals: { + ...globals.browser, + process: true, + global: true + } + } + }, + // TS files + { + files: ['**/*.{ts,tsx}'], + languageOptions: { + parser: tsParser, + parserOptions: { + ecmaFeatures: { modules: true }, + ecmaVersion: 'latest', + project: './tsconfig.json' + } + }, + plugins: { + '@typescript-eslint': ts + }, + rules: { + ...ts.configs['eslint-recommended'].rules, + ...ts.configs.recommended.rules, + 'no-undef': 'off', // redundant - TS will fail to compile with undefined vars + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'after-used', + ignoreRestSiblings: true, + argsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_' + } + ], + '@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }], // allow noop arrow functions, e.g. in a method signature for ensuring a parameter defaults to a function + '@typescript-eslint/prefer-namespace-keyword': 'off', // use ES module syntax instead of namespace + '@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }] + } + }, + // React / JSX files + // TODO: simplify as '**/*.{jsx,tsx}' + { + files: [ + 'app/**/*.js', + 'resources/Components/**/*.js', + 'resources/Native/**/*.js', + 'resources/svg/index.js', + 'test/app/**/*.js', + 'test/resources/Components/**/*.js', + 'test/jest.svg.js' + ], + plugins: { + react, + 'react-hooks': reactHooks + }, + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true + } + } + }, + settings: { + react: { + version: 'detect' + } + }, + rules: { + ...react.configs.recommended.rules, + ...react.configs['jsx-runtime'].rules, + ...reactHooks.configs.recommended.rules, + 'react/prop-types': 'off' // all type checking to be done in TS + } + }, + // Test files + { + files: ['test/**/*.js', '**/__mocks__/**/*.js'], + plugins: { + jest + }, + languageOptions: { + globals: { + ...globals.jest + } + } + // TODO: enable jest rules + // rules: { + // ...jest.configs.recommended.rules + // } + }, + // Components test files + { + files: ['test/app/**/*.js', 'test/resources/Components/**/*.js', 'app/**/__mocks__/**/*.js'], + plugins: { + 'testing-library': testingLibrary + }, + rules: { + ...testingLibrary.configs.react.rules + } + } +] diff --git a/main/accountData/activity/index.js b/main/accountData/activity/index.js deleted file mode 100644 index 09c9683e6..000000000 --- a/main/accountData/activity/index.js +++ /dev/null @@ -1,71 +0,0 @@ -// or - -// https://api.etherscan.io/api?module=account&action=txlistinternal&address=0x2c1ba59d6f58433fb1eaee7d20b26ed83bda51a3&startblock=0&endblock=2702578&page=1&offset=10&sort=asc&apikey=YourApiKeyToken -// (To get paginated results use page= and offset=) - -// Get "Internal Transactions" by Transaction Hash -// https://api.etherscan.io/api?module=account&action=txlistinternal&txhash=0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170&apikey=YourApiKeyToken -// (Returned 'isError' values: 0=Ok, 1=Rejected/Cancelled) - -// (Returns a maximum of 10000 records only) - -// Get "Internal Transactions" by Block Range -// https://api.etherscan.io/api?module=account&action=txlistinternal&startblock=0&endblock=2702578&page=1&offset=10&sort=asc&apikey=YourApiKeyToken -// (Returns a maximum of 10000 records only) - -// Get a list of "ERC20 - Token Transfer Events" by Address -// [Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results - -// (Returns a maximum of 10000 records only) - -// or - -// https://api.etherscan.io/api?module=account&action=tokentx&contractaddress=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2&page=1&offset=100&sort=asc&apikey=YourApiKeyToken -// (To get paginated results use page= and offset=) - -// or - -// https://api.etherscan.io/api?module=account&action=tokentx&contractaddress=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&page=1&offset=100&sort=asc&apikey=YourApiKeyToken -// (To get transfer events for a specific token contract, include the contractaddress parameter) - -// Get a list of "ERC721 - Token Transfer Events" by Address -// [Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results - -// https://api.etherscan.io/api?module=account&action=tokennfttx&address=0x6975be450864c02b4613023c2152ee0743572325&startblock=0&endblock=999999999&sort=asc&apikey=YourApiKeyToken -// (Returns a maximum of 10000 records only) - -// or - -// https://api.etherscan.io/api?module=account&action=tokennfttx&contractaddress=0x06012c8cf97bead5deae237070f9587f8e7a266d&page=1&offset=100&sort=asc&apikey=YourApiKeyToken -// (To get paginated results use page= and offset=) - -// or - -// https://api.etherscan.io/api?module=account&action=tokennfttx&contractaddress=0x06012c8cf97bead5deae237070f9587f8e7a266d&address=0x6975be450864c02b4613023c2152ee0743572325&page=1&offset=100&sort=asc&apikey=YourApiKeyToken -// (To get transfer events for a specific token contract, include the contractaddress parameter) - -const apiKey = '' - -const getNormalTransactions = (address) => { - fetch( - `https://api.etherscan.io/api?module=account&action=txlist&address=${address}&startblock=0&endblock=99999999&sort=asc&apikey=${apiKey}` - ) -} - -const getInternalTransactions = (address) => { - fetch( - `https://api.etherscan.io/api?module=account&action=txlistinternal&address=${address}&startblock=0&endblock=99999999&sort=asc&apikey=${apiKey}` - ) -} - -const getERC20TransferEvents = (address) => { - fetch( - `https://api.etherscan.io/api?module=account&action=tokentx&address=${address}&startblock=0&endblock=999999999&sort=asc&apikey=${apiKey}` - ) -} - -const getERC721TransferEvents = (address) => { - fetch( - `https://api.etherscan.io/api?module=account&action=tokennfttx&address=${address}&startblock=0&endblock=999999999&sort=asc&apikey=${apiKey}` - ) -} diff --git a/main/accounts/Account/index.ts b/main/accounts/Account/index.ts index 4c7a564a9..1833b87ab 100644 --- a/main/accounts/Account/index.ts +++ b/main/accounts/Account/index.ts @@ -14,7 +14,6 @@ import provider from '../../provider' import { ApprovalType } from '../../../resources/constants' import reveal from '../../reveal' -import type { Breadcrumb } from '../../windows/nav/breadcrumb' import type { TypedMessage } from '../types' const nebula = nebulaApi() diff --git a/main/accounts/index.ts b/main/accounts/index.ts index 4cd3bc75f..d261f05ff 100644 --- a/main/accounts/index.ts +++ b/main/accounts/index.ts @@ -14,7 +14,7 @@ import { signerCompatibility as transactionCompatibility, maxFee, SignerCompatib import { weiIntToEthInt, hexToInt } from '../../resources/utils' import { accountPanelCrumb, signerPanelCrumb } from '../../resources/domain/nav' import { usesBaseFee, TransactionData, GasFeesSource } from '../../resources/domain/transaction' -import { findUnavailableSigners, getSignerType, isSignerReady } from '../../resources/domain/signer' +import { findUnavailableSigners, isSignerReady } from '../../resources/domain/signer' import { AccountRequest, @@ -1164,7 +1164,7 @@ export class Accounts extends EventEmitter { // When a request is approved, lock it so that no automatic updates such as fee changes can happen const currentAccount = this.current() if (currentAccount && currentAccount.requests[handlerId]) { - ;(currentAccount.requests[handlerId] as TransactionRequest).locked = true + (currentAccount.requests[handlerId] as TransactionRequest).locked = true } else { log.error('Trying to lock request ' + handlerId + ' but there is no current account') } diff --git a/main/api/http.ts b/main/api/http.ts index 3ea67c681..eb01c942b 100644 --- a/main/api/http.ts +++ b/main/api/http.ts @@ -41,12 +41,6 @@ function extendSession(originId: string) { } } -const storeApi = { - getPermissions: (address: Address) => { - return store('main.permissions', address) as Record - } -} - const cleanup = (id: string) => { delete polls[id] delete pending[id] diff --git a/main/api/ws.ts b/main/api/ws.ts index 94cbf6816..9c1132b82 100644 --- a/main/api/ws.ts +++ b/main/api/ws.ts @@ -124,7 +124,7 @@ const handler = (socket: FrameWebSocket, req: IncomingMessage) => { } }) socket.on('error', (err) => log.error(err)) - socket.on('close', (_) => { + socket.on('close', () => { Object.keys(subs).forEach((sub) => { if (subs[sub].socket.id === socket.id) { provider.send({ diff --git a/main/chains/blocks/index.ts b/main/chains/blocks/index.ts index a1c9d2d10..91eeb7de7 100644 --- a/main/chains/blocks/index.ts +++ b/main/chains/blocks/index.ts @@ -72,7 +72,7 @@ class BlockMonitor extends EventEmitter { this.connection .send({ id: 1, jsonrpc: '2.0', method: 'eth_subscribe', params: ['newHeads'] }) .then((subId) => (this.subscriptionId = subId)) - .catch((err) => { + .catch(() => { // subscriptions are not supported, poll for block changes instead this.clearSubscription() diff --git a/main/chains/index.d.ts b/main/chains/index.d.ts index a8e5211a9..2bc9662d7 100644 --- a/main/chains/index.d.ts +++ b/main/chains/index.d.ts @@ -1,5 +1,4 @@ import { Common } from '@ethereumjs/common' -import { chainsType } from '@ethereumjs/common/dist/types' import { EventEmitter } from 'stream' export interface Chain { diff --git a/main/contracts/deployments/ens/index.ts b/main/contracts/deployments/ens/index.ts index e964292be..48c0989d4 100644 --- a/main/contracts/deployments/ens/index.ts +++ b/main/contracts/deployments/ens/index.ts @@ -17,7 +17,7 @@ import type { DecodableContract } from '../../../transaction/actions' // TODO: fix typing on contract types type EnsContract = DecodableContract -namespace ENS { +declare module ENS { export type Register = { name: string owner: string @@ -124,7 +124,7 @@ const registarController = ({ } if (['register', 'registerwithconfig'].includes(name.toLowerCase())) { - const { owner, name, duration, resolver } = args as unknown as ENS.Register + const { owner, name, duration } = args as unknown as ENS.Register return { id: 'ens:register', diff --git a/main/contracts/sources/etherscan.ts b/main/contracts/sources/etherscan.ts index d556baacd..00c18451d 100644 --- a/main/contracts/sources/etherscan.ts +++ b/main/contracts/sources/etherscan.ts @@ -18,7 +18,7 @@ interface ContractSourceCodeResult { Implementation: string } -const sourceCapture = /^https?:\/\/(?:api[\.-]?)?(?.*)\// +const sourceCapture = /^https?:\/\/(?:api[.-]?)?(?.*)\// const getEndpoint = (domain: string, contractAddress: string, apiKey: string) => { return `https://${domain}/api?module=contract&action=getsourcecode&address=${contractAddress}&apikey=${apiKey}` diff --git a/main/crypt/typedDataUtils.js b/main/crypt/typedDataUtils.js deleted file mode 100644 index 12b2deedf..000000000 --- a/main/crypt/typedDataUtils.js +++ /dev/null @@ -1,112 +0,0 @@ -// Translated to JavaScript from https://github.com/dicether/eip712/blob/master/src/eip712.ts -const abi = require('ethereumjs-abi') -const ethUtil = require('@ethereumjs/util') - -const PRIMITIVE_TYPES = [ - /^bytes[0-9]|[0-2][0-9]|3[0-2]$/, - /^(?:uint)8|16|32|64|128|256$/, - /^(?:int)8|16|32|64|128|256$/, - /^address$/, - /^bool$/, - /^bytes$/, - /^string$/ -] - -function isPrimitiveType(type) { - return PRIMITIVE_TYPES.some((regex) => regex.test(type)) -} - -// Recursively finds all the dependencies of a type -function dependencies(primaryType, types, found = []) { - if (found.includes(primaryType)) { - return found - } - if (types[primaryType] === undefined) { - if (!isPrimitiveType(primaryType)) { - throw Error(`${primaryType} is not a primitive type!`) - } - return found - } - found.push(primaryType) - for (const field of types[primaryType]) { - for (const dep of dependencies(field.type, types, found)) { - if (!found.includes(dep)) { - found.push(dep) - } - } - } - return found -} - -function encodeType(primaryType, types) { - // Get dependencies primary first, then alphabetical - let deps = dependencies(primaryType, types) - deps = deps.filter((t) => t !== primaryType) - deps = [primaryType].concat(deps.sort()) - - // Format as a string with fields - let result = '' - for (const depType of deps) { - result += `${depType}(${types[depType].map(({ name, type }) => `${type} ${name}`).join(',')})` - } - - return Buffer.from(result) -} - -function typeHash(primaryType, types) { - return ethUtil.keccak256(encodeType(primaryType, types)) -} - -function encodeData(primaryType, types, data) { - const encTypes = [] - const encValues = [] - - // Add typehash - encTypes.push('bytes32') - encValues.push(typeHash(primaryType, types)) - - // Add field contents - for (const field of types[primaryType]) { - const value = data[field.name] - if (value === undefined) { - throw Error(`Invalid typed data! Data for ${field.name} not found!`) - } - - if (field.type === 'string' || field.type === 'bytes') { - encTypes.push('bytes32') - const valueHash = ethUtil.keccak256(Buffer.from(value)) - encValues.push(valueHash) - } else if (types[field.type] !== undefined) { - encTypes.push('bytes32') - const valueHash = ethUtil.keccak256(encodeData(field.type, types, value)) - encValues.push(valueHash) - } else if (field.type.lastIndexOf(']') === field.type.length - 1) { - throw new Error('Arrays currently not implemented!') - } else { - if (!isPrimitiveType(field.type)) { - throw Error(`Invalid primitive type ${field.type}`) - } - - encTypes.push(field.type) - encValues.push(value) - } - } - - return abi.rawEncode(encTypes, encValues) -} - -function structHash(primaryType, types, data) { - return ethUtil.keccak256(encodeData(primaryType, types, data)) -} - -function hashTypedData(typedData) { - return ethUtil.keccak256( - Buffer.concat([ - Buffer.from('1901', 'hex'), - structHash('EIP712Domain', typedData.types, typedData.domain), - structHash(typedData.primaryType, typedData.types, typedData.message) - ]) - ) -} - -module.exports = { hashTypedData } diff --git a/main/dapps/index.ts b/main/dapps/index.ts index 7c35d9226..71d5c74d8 100644 --- a/main/dapps/index.ts +++ b/main/dapps/index.ts @@ -101,7 +101,7 @@ let nextId = 0 const getId = () => (++nextId).toString() const surface = { - manifest: (ens: string) => { + manifest: (_ens: string) => { // gets the dapp manifest and returns all options and details for user to confirm before installing }, add: (dapp: Dapp) => { @@ -119,7 +119,7 @@ const surface = { // If ens name has not been installed, start install store.appDapp({ id, ens, status, config, manifest: {}, current: {} }) }, - addServerSession(namehash: string /* , session */) { + addServerSession(_namehash: string /* , session */) { // server.sessions.add(namehash, session) }, unsetCurrentView(frameId: string) { diff --git a/main/dapps/server/inject/index.js b/main/dapps/server/inject/index.js index f05a7c58f..4d206de7b 100644 --- a/main/dapps/server/inject/index.js +++ b/main/dapps/server/inject/index.js @@ -1,5 +1,3 @@ -/* globals WebSocket, initial */ - window.ethereum = require('eth-provider')('frame') // let storage = initial diff --git a/main/ens/index.js b/main/ens/index.js index e104e9ea7..270cba2d3 100644 --- a/main/ens/index.js +++ b/main/ens/index.js @@ -122,7 +122,7 @@ const getResolverAddress = async (name) => { } const makeCall = (method, params) => { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { // Construct JSON RPC payload const payload = { jsonrpc: '2.0', id: 1, method: method, params: [params, 'latest'] } diff --git a/main/errors/index.ts b/main/errors/index.ts index 97ed341c1..7b47b61d8 100644 --- a/main/errors/index.ts +++ b/main/errors/index.ts @@ -15,7 +15,7 @@ function getCrashReportFields() { } function sanitizeStackFrame({ module = '' }) { - const matches = /(.+)[\\|\/]frame[\\|\/]resources[\\|\/]app.asar[\\|\/](.+)/.exec(module) + const matches = /(.+)[\\|/]frame[\\|/]resources[\\|/]app.asar[\\|/](.+)/.exec(module) if (matches && matches[2]) { return `{asar}/${matches[2].replaceAll('\\', '/')}` } diff --git a/main/externalData/balances/worker.ts b/main/externalData/balances/worker.ts index d888797d6..750519ae8 100644 --- a/main/externalData/balances/worker.ts +++ b/main/externalData/balances/worker.ts @@ -8,7 +8,7 @@ log.transports.file.level = ['development', 'test'].includes(process.env.NODE_EN : 'verbose' import { supportsChain as chainSupportsScan } from '../../multicall' -import balancesLoader, { BalanceLoader, TokenBalance } from './scan' +import balancesLoader, { BalanceLoader } from './scan' import TokenLoader from '../inventory/tokens' import { toTokenId } from '../../../resources/domain/balance' diff --git a/main/index.ts b/main/index.ts index 41d6df725..2c5066a50 100644 --- a/main/index.ts +++ b/main/index.ts @@ -95,7 +95,7 @@ function startUpdater() { global.eval = () => { throw new Error(`This app does not support global.eval()`) -} // eslint-disable-line +} ipcMain.on('tray:resetAllSettings', () => { persist.clear() @@ -226,7 +226,7 @@ ipcMain.on('tray:removeOrigin', (e, handlerId) => { store.removeOrigin(handlerId) }) -ipcMain.on('tray:clearOrigins', (e) => { +ipcMain.on('tray:clearOrigins', () => { Object.keys(store('main.origins')).forEach((handlerId) => { accounts.removeRequests(handlerId) }) @@ -272,7 +272,7 @@ dapps.add({ } }) -ipcMain.on('unsetCurrentView', async (e, ens) => { +ipcMain.on('unsetCurrentView', async (e) => { const win = BrowserWindow.fromWebContents(e.sender) as FrameInstance dapps.unsetCurrentView(win.frameId as string) }) @@ -312,7 +312,7 @@ app.on('ready', () => { const appOrigin = path.resolve(__dirname, '../../') const filePath = url.fileURLToPath(req.url) - if (filePath.startsWith(appOrigin)) cb({ path: filePath }) // eslint-disable-line + if (filePath.startsWith(appOrigin)) cb({ path: filePath }) }) }) @@ -327,7 +327,7 @@ app.on('second-instance', (event, argv, workingDirectory) => { }) app.on('activate', () => windows.showTray()) -app.on('before-quit', (evt) => { +app.on('before-quit', () => { if (!updater.updateReady) { updater.stop() } diff --git a/main/ipfsRun/index.js b/main/ipfsRun/index.js index aefd686d5..1526f0a03 100644 --- a/main/ipfsRun/index.js +++ b/main/ipfsRun/index.js @@ -1,11 +1,6 @@ const ipfs = require('ipfs-core') const peers = require('./peers.json') -const store = require('../store').default - -// const peers = require('./peers.json') -const ens = require('../ens') - let node const api = { @@ -66,7 +61,7 @@ const start = async () => { } } await connectPeers() - const id = await node.id() + await node.id() } catch (e) { // destryo ipfs instance... diff --git a/main/multicall/index.ts b/main/multicall/index.ts index 12207355c..172009d47 100644 --- a/main/multicall/index.ts +++ b/main/multicall/index.ts @@ -145,7 +145,7 @@ export default function (chainId: number, eth: EthereumProvider) { )}`, e ) - return [...Array(batchCalls.length).keys()].map((n) => ({ success: false, returnValues: [] })) + return [...Array(batchCalls.length).keys()].map(() => ({ success: false, returnValues: [] })) } }) diff --git a/main/provider/chains/index.ts b/main/provider/chains/index.ts index 0d18b7529..530ca0f2d 100644 --- a/main/provider/chains/index.ts +++ b/main/provider/chains/index.ts @@ -1,7 +1,6 @@ -// @ts-ignore import deepEqual from 'deep-equal' -import { getColor } from '../../../resources/colors' +import { Colorway, getColor } from '../../../resources/colors' import store from '../../store' // typed access to state diff --git a/main/provider/helpers.ts b/main/provider/helpers.ts index 99cc31026..dc0c2f1b4 100644 --- a/main/provider/helpers.ts +++ b/main/provider/helpers.ts @@ -131,7 +131,7 @@ export function resError(errorData: string | EVMError, request: RPCId, res: RPCE res({ id: request.id, jsonrpc: request.jsonrpc, error }) } -export function getSignedAddress(signed: string, message: string, cb: Callback) { +export function getSignedAddress(signed: string, message: string, cb: Callback) { const signature = Buffer.from((signed || '').replace('0x', ''), 'hex') if (signature.length !== 65) return cb(new Error('Frame verifySignature: Signature has incorrect length')) let v = signature[64] diff --git a/main/reveal/index.ts b/main/reveal/index.ts index d02026cb3..18d3358e8 100644 --- a/main/reveal/index.ts +++ b/main/reveal/index.ts @@ -151,7 +151,7 @@ function identifyKnownContractActions( } const surface = { - identity: async (address: string = '', chainId: number) => { + identity: async (address = '', chainId: number) => { // Resolve ens, type and other data about address entities const [type, ens] = await Promise.all([resolveEntityType(address, chainId), resolveEnsName(address)]) // TODO: Check the address against various scam dbs @@ -159,7 +159,7 @@ const surface = { // TODO: Check the address against previously verified contracts return { type, ens } }, - decode: async (contractAddress: string = '', chainId: number, calldata: string) => { + decode: async (contractAddress = '', chainId: number, calldata: string) => { // Decode calldata const contractSources: ContractSource[] = [{ name: 'ERC-20', source: 'Generic ERC-20', abi: erc20Abi }] const contractSource = await fetchContract(contractAddress, chainId) @@ -191,8 +191,8 @@ const surface = { ) return actions - }, - simulate: async () => {} + } + // simulate: async () => {} } export default surface diff --git a/main/rpc/index.js b/main/rpc/index.js index eddcd7bf6..dd82fbec0 100644 --- a/main/rpc/index.js +++ b/main/rpc/index.js @@ -131,13 +131,13 @@ const rpc = { } }) }, - confirmRequestApproval(req, approvalType, approvalData, cb) { + confirmRequestApproval(req, approvalType, approvalData) { accounts.confirmRequestApproval(req.handlerId, approvalType, approvalData) }, - updateRequest(reqId, actionId, data, cb = () => {}) { + updateRequest(reqId, actionId, data) { accounts.updateRequest(reqId, actionId, data) }, - approveRequest(req, cb) { + approveRequest(req) { accounts.setRequestPending(req) if (req.type === 'transaction') { provider.approveTransactionRequest(req, (err, res) => { @@ -156,7 +156,7 @@ const rpc = { }) } }, - declineRequest(req, cb) { + declineRequest(req) { if (req.type === 'transaction' || req.type === 'sign' || req.type === 'signTypedData') { accounts.declineRequest(req.handlerId) provider.declineRequest(req) @@ -172,7 +172,7 @@ const rpc = { accounts.add(address, name, options) cb() }, - removeAccount(address, options, cb) { + removeAccount(address, _options, cb) { accounts.remove(address) cb() }, @@ -261,7 +261,7 @@ const rpc = { accounts.signerCompatibility(handlerId, cb) }, // flow - async flowCommand(command, cb) { + async flowCommand(command) { // console.log('flowCommand', command, cb) await dapps.add(command.input, {}, (err, res) => { if (err || res) console.log(err, res) diff --git a/main/signers/hot/RingSigner/worker.js b/main/signers/hot/RingSigner/worker.js index 31762a6a2..b26b254ca 100644 --- a/main/signers/hot/RingSigner/worker.js +++ b/main/signers/hot/RingSigner/worker.js @@ -78,4 +78,4 @@ class RingSignerWorker extends HotSignerWorker { } } -const ringSignerWorker = new RingSignerWorker() // eslint-disable-line +const ringSignerWorker = new RingSignerWorker() diff --git a/main/signers/hot/SeedSigner/worker.js b/main/signers/hot/SeedSigner/worker.js index 4245411bf..81b30ed13 100644 --- a/main/signers/hot/SeedSigner/worker.js +++ b/main/signers/hot/SeedSigner/worker.js @@ -60,4 +60,4 @@ class SeedSignerWorker extends HotSignerWorker { } } -const seedSignerWorker = new SeedSignerWorker() // eslint-disable-line +const seedSignerWorker = new SeedSignerWorker() diff --git a/main/store/actions/index.js b/main/store/actions/index.js index 0c1e2235d..9adc7ccc1 100644 --- a/main/store/actions/index.js +++ b/main/store/actions/index.js @@ -80,7 +80,7 @@ module.exports = { return Object.assign({}, secondary, status) }) }, - setLaunch: (u, launch) => u('main.launch', (_) => launch), + setLaunch: (u, launch) => u('main.launch', () => launch), toggleLaunch: (u) => u('main.launch', (launch) => !launch), toggleReveal: (u) => u('main.reveal', (reveal) => !reveal), toggleNonceAdjust: (u) => u('main.nonceAdjust', (nonceAdjust) => !nonceAdjust), @@ -120,9 +120,9 @@ module.exports = { }) }, setAccount: (u, account) => { - u('selected.current', (_) => account.id) - u('selected.minimized', (_) => false) - u('selected.open', (_) => true) + u('selected.current', () => account.id) + u('selected.minimized', () => false) + u('selected.open', () => true) }, setAccountSignerStatusOpen: (u, value) => { u('selected.signerStatusOpen', () => Boolean(value)) @@ -522,7 +522,7 @@ module.exports = { }) }, expandDock: (u, expand) => { - u('dock.expand', (s) => expand) + u('dock.expand', () => expand) }, pin: (u) => { u('main.pin', (pin) => !pin) @@ -812,12 +812,12 @@ module.exports = { }) }, unsetAccount: (u) => { - u('selected.open', (_) => false) - u('selected.minimized', (_) => true) - u('selected.view', (_) => 'default') - u('selected.showAccounts', (_) => false) + u('selected.open', () => false) + u('selected.minimized', () => true) + u('selected.view', () => 'default') + u('selected.showAccounts', () => false) u('windows.panel.nav', () => []) - setTimeout((_) => { + setTimeout(() => { u('selected', (signer) => { signer.last = signer.current signer.current = '' diff --git a/main/store/state/index.js b/main/store/state/index.js index f3eec2091..8b589d94a 100644 --- a/main/store/state/index.js +++ b/main/store/state/index.js @@ -26,7 +26,7 @@ const latestStateVersion = () => { } const get = (path, obj = latestStateVersion()) => { - path.split('.').some((key, i) => { + path.split('.').some((key) => { if (typeof obj !== 'object') { obj = undefined } else { @@ -576,7 +576,6 @@ const initial = { } }, nativeCurrency: { - symbol: 'ETH', usd: { price: 0, change24hr: 0 @@ -643,7 +642,6 @@ const initial = { } }, nativeCurrency: { - symbol: 'ETH', usd: { price: 0, change24hr: 0 diff --git a/main/time/index.js b/main/time/index.js deleted file mode 100644 index c2ada0af0..000000000 --- a/main/time/index.js +++ /dev/null @@ -1,9 +0,0 @@ -// Return Frame Time - -const counts = {} - -module.exports = async (blockNumber) => { - if (!blockNumber) blockNumber = await provider.request({ method: 'eth_blockNumbr' }) - counts[blockNumber] = counts[blockNumber] || 0 - return blockNumber + ':' + counts[blockNumber] -} diff --git a/main/windows/dialog/unhandledException.ts b/main/windows/dialog/unhandledException.ts index b470b1b5b..f72d80340 100644 --- a/main/windows/dialog/unhandledException.ts +++ b/main/windows/dialog/unhandledException.ts @@ -1,4 +1,4 @@ -const { app, dialog } = require('electron') +import { app, dialog } from 'electron' enum ExitAction { OK, diff --git a/main/windows/frames/index.ts b/main/windows/frames/index.ts index 1d0f7c5e5..c4986e02e 100644 --- a/main/windows/frames/index.ts +++ b/main/windows/frames/index.ts @@ -1,7 +1,5 @@ // Frames are the windows that run dapps and other functionality // They are rendered based on the state of `main.frames` - -import { screen } from 'electron' import log from 'electron-log' import store from '../../store' diff --git a/main/windows/frames/viewInstances.ts b/main/windows/frames/viewInstances.ts index ad3a55b79..7f46a698f 100644 --- a/main/windows/frames/viewInstances.ts +++ b/main/windows/frames/viewInstances.ts @@ -6,12 +6,12 @@ import store from '../../store' import server from '../../dapps/server' import { createViewInstance } from '../window' -interface extract { +interface Extract { session: string ens: string } -const extract = (l: string): extract => { +const extract = (l: string): Extract => { const url = new URL(l) const session = url.searchParams.get('session') || '' const ens = url.port === '8421' ? url.hostname.replace('.localhost', '') || '' : '' diff --git a/main/windows/nav/index.ts b/main/windows/nav/index.ts index b433fa7dd..e06f9f9ff 100644 --- a/main/windows/nav/index.ts +++ b/main/windows/nav/index.ts @@ -14,7 +14,7 @@ const nav = { // Removes last crumb from nav array store.navBack(windowId, steps) }, - update: (windowId: string, crumb: Breadcrumb, navigate: boolean = true) => { + update: (windowId: string, crumb: Breadcrumb, navigate = true) => { // Updated last crumb in nav array with new data // Replaces last crumb when navigate is false // Adds new crumb to nav array when navigate is true diff --git a/package-lock.json b/package-lock.json index 775e2bd81..c97cbd72a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,6 +85,7 @@ "@testing-library/react": "13.4.0", "@testing-library/user-event": "14.4.3", "@types/cookie": "0.5.1", + "@types/deep-equal": "1.0.1", "@types/get-pixels": "3.3.2", "@types/hdkey": "2.0.1", "@types/jest": "29.2.4", @@ -93,10 +94,18 @@ "@types/node-hid": "1.3.1", "@types/uuid": "9.0.0", "@types/ws": "8.5.3", + "@typescript-eslint/eslint-plugin": "5.48.1", + "@typescript-eslint/parser": "5.48.1", "electron": "22.0.0", "electron-builder": "23.6.0", "electron-devtools-installer": "3.2.0", - "eslint": "8.29.0", + "eslint": "8.31.0", + "eslint-config-prettier": "8.6.0", + "eslint-plugin-jest": "27.2.1", + "eslint-plugin-react": "7.32.0", + "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-testing-library": "5.9.1", + "globals": "13.19.0", "hardhat": "2.12.3", "husky": "8.0.2", "jest": "29.3.1", @@ -118,7 +127,8 @@ "wait-on": "6.0.1" }, "engines": { - "electron": "22" + "electron": "22", + "node": ">= 16.15.0" } }, "node_modules/@adobe/css-tools": { @@ -1450,6 +1460,15 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-classes/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/plugin-transform-computed-properties": { "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz", @@ -2168,6 +2187,14 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/types": { "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", @@ -2527,9 +2554,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", - "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -2563,36 +2590,11 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@ethereumjs/common": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-3.0.1.tgz", @@ -7340,33 +7342,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/@parcel/packager-js/node_modules/globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@parcel/packager-js/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@parcel/packager-raw": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/@parcel/packager-raw/-/packager-raw-2.8.0.tgz", @@ -10063,6 +10038,12 @@ "@types/ms": "*" } }, + "node_modules/@types/deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha512-mMUu4nWHLBlHtxXY17Fg6+ucS/MnndyOWyOe7MmwkoMYxvfQU2ajtRaEvqSUv+aVkMqH/C0NCI8UoVfRNQ10yg==", + "dev": true + }, "node_modules/@types/fs-extra": { "version": "9.0.13", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", @@ -10188,6 +10169,12 @@ "parse5": "^7.0.0" } }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, "node_modules/@types/keyv": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", @@ -10409,6 +10396,215 @@ "@types/node": "*" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.1.tgz", + "integrity": "sha512-9nY5K1Rp2ppmpb9s9S2aBiF3xo5uExCehMDmYmmFqqyxgenbHJ3qbarcLt4ITgaD6r/2ypdlcFRdcuVPnks+fQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/type-utils": "5.48.1", + "@typescript-eslint/utils": "5.48.1", + "debug": "^4.3.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.1.tgz", + "integrity": "sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/typescript-estree": "5.48.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.1.tgz", + "integrity": "sha512-S035ueRrbxRMKvSTv9vJKIWgr86BD8s3RqoRZmsSh/s8HhIs90g6UlK8ZabUSjUZQkhVxt7nmZ63VJ9dcZhtDQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/visitor-keys": "5.48.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.1.tgz", + "integrity": "sha512-Hyr8HU8Alcuva1ppmqSYtM/Gp0q4JOp1F+/JH5D1IZm/bUBrV0edoewQZiEc1r6I8L4JL21broddxK8HAcZiqQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "5.48.1", + "@typescript-eslint/utils": "5.48.1", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.1.tgz", + "integrity": "sha512-xHyDLU6MSuEEdIlzrrAerCGS3T7AA/L8Hggd0RCYBi0w3JMvGYxlLlXHeg50JI9Tfg5MrtsfuNxbS/3zF1/ATg==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.1.tgz", + "integrity": "sha512-Hut+Osk5FYr+sgFh8J/FHjqX6HFcDzTlWLrFqGoK5kVUN3VBHF/QzZmAsIXCQ8T/W9nQNBTqalxi1P3LSqWnRA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/visitor-keys": "5.48.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.1.tgz", + "integrity": "sha512-SmQuSrCGUOdmGMwivW14Z0Lj8dxG1mOFZ7soeJ0TQZEJcs3n5Ndgkg0A4bcMFzBELqLJ6GTHnEU+iIoaD6hFGA==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/typescript-estree": "5.48.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.1.tgz", + "integrity": "sha512-Ns0XBwmfuX7ZknznfXozgnydyR8F6ev/KEGePP4i74uL3ArsKbEhJ7raeKr1JSa997DBDwol/4a0Y+At82c9dA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.48.1", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@zxing/text-encoding": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", @@ -10784,6 +10980,52 @@ "deep-equal": "^2.0.5" } }, + "node_modules/array-includes": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.reduce": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz", @@ -10803,6 +11045,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz", + "integrity": "sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + } + }, "node_modules/asar": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/asar/-/asar-3.2.0.tgz", @@ -13453,6 +13708,18 @@ "node": "*" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/dmg-builder": { "version": "23.6.0", "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-23.6.0.tgz", @@ -14245,6 +14512,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -14365,12 +14641,12 @@ } }, "node_modules/eslint": { - "version": "8.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", - "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", + "version": "8.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz", + "integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==", "dependencies": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -14389,7 +14665,7 @@ "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", @@ -14419,6 +14695,137 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-jest": { + "version": "27.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.2.1.tgz", + "integrity": "sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "^5.10.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^5.0.0", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + }, + "jest": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.32.0.tgz", + "integrity": "sha512-vSBi1+SrPiLZCGvxpiZIa28fMEUaMjXtCplrvxcIxGzmFiYdsXQDwInEjuv5/i/2CTTxbkS87tE8lsQ0Qxinbw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "array.prototype.tosorted": "^1.1.1", + "doctrine": "^2.1.0", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "object.hasown": "^1.1.2", + "object.values": "^1.1.6", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.4", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.8" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", + "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", + "dev": true, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "dev": true, + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-testing-library": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.9.1.tgz", + "integrity": "sha512-6BQp3tmb79jLLasPHJmy8DnxREe+2Pgf7L+7o09TSWPfdqqtQfRZmZNetr5mOs3yqZk/MRNxpN3RUpJe0wB4LQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "^5.13.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0", + "npm": ">=6" + }, + "peerDependencies": { + "eslint": "^7.5.0 || ^8.0.0" + } + }, "node_modules/eslint-scope": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", @@ -14535,20 +14942,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -14573,17 +14966,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/espree": { "version": "9.4.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", @@ -15120,6 +15502,34 @@ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.1.0.tgz", "integrity": "sha512-Kl29QoNbNvn4nhDsLYjyIAaIqaJB6rBx5p3sL9VjaefJ+eMFBWVZiaoguaoZfzEKr5RhAti0UgM8703akGPJ6g==" }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -15610,11 +16020,28 @@ } }, "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "dependencies": { + "type-fest": "^0.20.2" + }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalthis": { @@ -15633,6 +16060,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -19997,6 +20444,19 @@ "extsprintf": "^1.2.0" } }, + "node_modules/jsx-ast-utils": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz", + "integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.5", + "object.assign": "^4.1.3" + }, + "engines": { + "node": ">=4.0" + } + }, "node_modules/jszip": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", @@ -21181,6 +21641,15 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -21704,6 +22173,12 @@ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node_modules/ndarray": { "version": "1.0.19", "resolved": "https://registry.npmjs.org/ndarray/-/ndarray-1.0.19.tgz", @@ -22279,6 +22754,37 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.entries": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.6.tgz", + "integrity": "sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object.getownpropertydescriptors": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz", @@ -22297,6 +22803,36 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.hasown": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.2.tgz", + "integrity": "sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.values": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/obliterator": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", @@ -25264,6 +25800,25 @@ "node": ">=8" } }, + "node_modules/string.prototype.matchall": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", + "integrity": "sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.4.3", + "side-channel": "^1.0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/string.prototype.trimend": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", @@ -25960,6 +26515,27 @@ "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", "dev": true }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -27742,6 +28318,14 @@ "@babel/helper-replace-supers": "^7.20.7", "@babel/helper-split-export-declaration": "^7.18.6", "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } } }, "@babel/plugin-transform-computed-properties": { @@ -28231,6 +28815,13 @@ "@babel/types": "^7.20.7", "debug": "^4.1.0", "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" + } } }, "@babel/types": { @@ -28541,9 +29132,9 @@ } }, "@eslint/eslintrc": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", - "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -28567,23 +29158,10 @@ "uri-js": "^4.2.2" } }, - "globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", - "requires": { - "type-fest": "^0.20.2" - } - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" } } }, @@ -31922,23 +32500,6 @@ "@parcel/utils": "2.8.0", "globals": "^13.2.0", "nullthrows": "^1.1.1" - }, - "dependencies": { - "globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - } } }, "@parcel/packager-raw": { @@ -33845,6 +34406,12 @@ "@types/ms": "*" } }, + "@types/deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha512-mMUu4nWHLBlHtxXY17Fg6+ucS/MnndyOWyOe7MmwkoMYxvfQU2ajtRaEvqSUv+aVkMqH/C0NCI8UoVfRNQ10yg==", + "dev": true + }, "@types/fs-extra": { "version": "9.0.13", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", @@ -33963,6 +34530,12 @@ "parse5": "^7.0.0" } }, + "@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, "@types/keyv": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", @@ -34184,6 +34757,122 @@ "@types/node": "*" } }, + "@typescript-eslint/eslint-plugin": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.1.tgz", + "integrity": "sha512-9nY5K1Rp2ppmpb9s9S2aBiF3xo5uExCehMDmYmmFqqyxgenbHJ3qbarcLt4ITgaD6r/2ypdlcFRdcuVPnks+fQ==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/type-utils": "5.48.1", + "@typescript-eslint/utils": "5.48.1", + "debug": "^4.3.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/parser": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.1.tgz", + "integrity": "sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/typescript-estree": "5.48.1", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.1.tgz", + "integrity": "sha512-S035ueRrbxRMKvSTv9vJKIWgr86BD8s3RqoRZmsSh/s8HhIs90g6UlK8ZabUSjUZQkhVxt7nmZ63VJ9dcZhtDQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/visitor-keys": "5.48.1" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.1.tgz", + "integrity": "sha512-Hyr8HU8Alcuva1ppmqSYtM/Gp0q4JOp1F+/JH5D1IZm/bUBrV0edoewQZiEc1r6I8L4JL21broddxK8HAcZiqQ==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "5.48.1", + "@typescript-eslint/utils": "5.48.1", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/types": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.1.tgz", + "integrity": "sha512-xHyDLU6MSuEEdIlzrrAerCGS3T7AA/L8Hggd0RCYBi0w3JMvGYxlLlXHeg50JI9Tfg5MrtsfuNxbS/3zF1/ATg==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.1.tgz", + "integrity": "sha512-Hut+Osk5FYr+sgFh8J/FHjqX6HFcDzTlWLrFqGoK5kVUN3VBHF/QzZmAsIXCQ8T/W9nQNBTqalxi1P3LSqWnRA==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/visitor-keys": "5.48.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/utils": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.1.tgz", + "integrity": "sha512-SmQuSrCGUOdmGMwivW14Z0Lj8dxG1mOFZ7soeJ0TQZEJcs3n5Ndgkg0A4bcMFzBELqLJ6GTHnEU+iIoaD6hFGA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/typescript-estree": "5.48.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" + }, + "dependencies": { + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.1.tgz", + "integrity": "sha512-Ns0XBwmfuX7ZknznfXozgnydyR8F6ev/KEGePP4i74uL3ArsKbEhJ7raeKr1JSa997DBDwol/4a0Y+At82c9dA==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.48.1", + "eslint-visitor-keys": "^3.3.0" + } + }, "@zxing/text-encoding": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", @@ -34478,6 +35167,37 @@ "deep-equal": "^2.0.5" } }, + "array-includes": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "is-string": "^1.0.7" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + } + }, "array.prototype.reduce": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz", @@ -34491,6 +35211,19 @@ "is-string": "^1.0.7" } }, + "array.prototype.tosorted": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz", + "integrity": "sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + } + }, "asar": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/asar/-/asar-3.2.0.tgz", @@ -36601,6 +37334,15 @@ } } }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, "dmg-builder": { "version": "23.6.0", "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-23.6.0.tgz", @@ -37237,6 +37979,15 @@ "isarray": "^2.0.5" } }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -37326,12 +38077,12 @@ } }, "eslint": { - "version": "8.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", - "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", + "version": "8.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.31.0.tgz", + "integrity": "sha512-0tQQEVdmPZ1UtUKXjX7EMm9BlgJ08G90IhWh0PKDCb3ZLsgAOHI8fYSIzYVZej92zsgq+ft0FGsxhJ3xo2tbuA==", "requires": { - "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.11.6", + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -37350,7 +38101,7 @@ "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.15.0", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", @@ -37417,14 +38168,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, - "globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", - "requires": { - "type-fest": "^0.20.2" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -37442,14 +38185,92 @@ "requires": { "has-flag": "^4.0.0" } + } + } + }, + "eslint-config-prettier": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "dev": true, + "requires": {} + }, + "eslint-plugin-jest": { + "version": "27.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.2.1.tgz", + "integrity": "sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "^5.10.0" + } + }, + "eslint-plugin-react": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.32.0.tgz", + "integrity": "sha512-vSBi1+SrPiLZCGvxpiZIa28fMEUaMjXtCplrvxcIxGzmFiYdsXQDwInEjuv5/i/2CTTxbkS87tE8lsQ0Qxinbw==", + "dev": true, + "requires": { + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "array.prototype.tosorted": "^1.1.1", + "doctrine": "^2.1.0", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "object.hasown": "^1.1.2", + "object.values": "^1.1.6", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.4", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.8" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" + "resolve": { + "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "dev": true, + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, + "eslint-plugin-react-hooks": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", + "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", + "dev": true, + "requires": {} + }, + "eslint-plugin-testing-library": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.9.1.tgz", + "integrity": "sha512-6BQp3tmb79jLLasPHJmy8DnxREe+2Pgf7L+7o09TSWPfdqqtQfRZmZNetr5mOs3yqZk/MRNxpN3RUpJe0wB4LQ==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "^5.13.0" + } + }, "eslint-scope": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", @@ -37914,6 +38735,30 @@ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.1.0.tgz", "integrity": "sha512-Kl29QoNbNvn4nhDsLYjyIAaIqaJB6rBx5p3sL9VjaefJ+eMFBWVZiaoguaoZfzEKr5RhAti0UgM8703akGPJ6g==" }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -38295,9 +39140,19 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" + } + } }, "globalthis": { "version": "1.0.3", @@ -38309,6 +39164,20 @@ "define-properties": "^1.1.3" } }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, "gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -41563,6 +42432,16 @@ } } }, + "jsx-ast-utils": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz", + "integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==", + "dev": true, + "requires": { + "array-includes": "^3.1.5", + "object.assign": "^4.1.3" + } + }, "jszip": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", @@ -42389,6 +43268,12 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, "micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -42810,6 +43695,12 @@ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "ndarray": { "version": "1.0.19", "resolved": "https://registry.npmjs.org/ndarray/-/ndarray-1.0.19.tgz", @@ -43226,6 +44117,28 @@ "object-keys": "^1.1.1" } }, + "object.entries": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.6.tgz", + "integrity": "sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, + "object.fromentries": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, "object.getownpropertydescriptors": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz", @@ -43238,6 +44151,27 @@ "es-abstract": "^1.20.4" } }, + "object.hasown": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.2.tgz", + "integrity": "sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==", + "dev": true, + "requires": { + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, + "object.values": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, "obliterator": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", @@ -45442,6 +46376,22 @@ "strip-ansi": "^6.0.1" } }, + "string.prototype.matchall": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", + "integrity": "sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.4.3", + "side-channel": "^1.0.4" + } + }, "string.prototype.trimend": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", @@ -45968,6 +46918,23 @@ "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", "dev": true }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", diff --git a/package.json b/package.json index dcd133267..284cf09a4 100644 --- a/package.json +++ b/package.json @@ -29,11 +29,13 @@ "launch:dev:fullheight": "cross-env NODE_ENV=development FULL_HEIGHT=true ELECTRON_DISABLE_SECURITY_WARNINGS=true electron ./compiled/main --inspect", "launch:dev:worker": "cross-env NODE_ENV=development LOG_WORKER=true electron ./compiled/main", "launch:inspect": "cross-env NODE_ENV=production electron --inspect ./compiled/main", + "lint": "ESLINT_USE_FLAT_CONFIG=true eslint -c eslint.config.mjs .", + "lint:fix": "eslint --fix .", "format": "prettier --write '**/*.{yml,json,md,html,ts,js}'", "format:check": "prettier --check '**/*.{yml,json,md,html,ts,js}'", "prod": "npm run compile && npm run bundle && npm run launch", - "compile": "npm run copy-assets && tsc", - "compile:watch": "npm run copy-assets && tsc -w", + "compile": "npm run copy-assets && tsc --project tsconfig.build.json", + "compile:watch": "npm run copy-assets && tsc --project tsconfig.build.json -w", "build": "npm run compile && sleep 4 && npm run bundle && sleep 4 && electron-builder", "copy-assets": "shx mkdir -p ./compiled/main/windows && shx cp ./main/windows/*.png ./compiled/main/windows", "publish": "electron-builder -c.snap.publish=github", @@ -69,6 +71,7 @@ "@ledgerhq/hw-transport-web-ble": "6.27.8", "@metamask/eth-sig-util": "5.0.2", "@sentry/electron": "4.1.2", + "@trezor/connect": "9.0.5", "auto-launch": "5.0.5", "bip39": "3.0.4", "cheerio": "1.0.0-rc.12", @@ -99,7 +102,6 @@ "rlp": "3.0.0", "semver": "7.3.8", "styled-components": "5.3.6", - "@trezor/connect": "9.0.5", "uuid": "9.0.0", "ws": "8.11.0", "zxcvbn": "4.4.2" @@ -131,6 +133,7 @@ "@testing-library/react": "13.4.0", "@testing-library/user-event": "14.4.3", "@types/cookie": "0.5.1", + "@types/deep-equal": "1.0.1", "@types/get-pixels": "3.3.2", "@types/hdkey": "2.0.1", "@types/jest": "29.2.4", @@ -139,10 +142,18 @@ "@types/node-hid": "1.3.1", "@types/uuid": "9.0.0", "@types/ws": "8.5.3", + "@typescript-eslint/eslint-plugin": "5.48.1", + "@typescript-eslint/parser": "5.48.1", "electron": "22.0.0", "electron-builder": "23.6.0", "electron-devtools-installer": "3.2.0", - "eslint": "8.29.0", + "eslint": "8.31.0", + "eslint-config-prettier": "8.6.0", + "eslint-plugin-jest": "27.2.1", + "eslint-plugin-react": "7.32.0", + "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-testing-library": "5.9.1", + "globals": "13.19.0", "hardhat": "2.12.3", "husky": "8.0.2", "jest": "29.3.1", @@ -177,7 +188,8 @@ "url": false }, "engines": { - "electron": "22" + "electron": "22", + "node": ">= 16.15.0" }, "browserslist": [ "last 1 Electron major version" diff --git a/resources/Components/Cluster/index.js b/resources/Components/Cluster/index.js index 5b94defdd..f14ef4068 100644 --- a/resources/Components/Cluster/index.js +++ b/resources/Components/Cluster/index.js @@ -1,5 +1,3 @@ -import React from 'react' - export const ClusterValue = ({ children, style = {}, diff --git a/resources/Components/Confirm/index.js b/resources/Components/Confirm/index.js index 30425b6c2..a9abb7f9a 100644 --- a/resources/Components/Confirm/index.js +++ b/resources/Components/Confirm/index.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import { useState } from 'react' export default function ConfirmDialog({ prompt, diff --git a/resources/Components/DisplayValue/index.js b/resources/Components/DisplayValue/index.js index 8471ce7dd..01db146a2 100644 --- a/resources/Components/DisplayValue/index.js +++ b/resources/Components/DisplayValue/index.js @@ -1,4 +1,3 @@ -import React from 'react' import { displayValueData } from '../../utils/displayValue' import BigNumber from 'bignumber.js' diff --git a/resources/Components/Dropdown/index.js b/resources/Components/Dropdown/index.js index 2c4997c9f..d326a2deb 100644 --- a/resources/Components/Dropdown/index.js +++ b/resources/Components/Dropdown/index.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect, createRef } from 'react' +import { useState, useEffect, createRef } from 'react' function findIndex(options, value) { const index = options.findIndex((option) => option.value === value) @@ -55,7 +55,7 @@ const Dropdown = ({ options, syncValue, initialValue, style, className = '', onC
setExpanded(!expanded)} + onClick={() => setExpanded(!expanded)} >
{options.map((option, index) => { diff --git a/resources/Components/Gas/index.js b/resources/Components/Gas/index.js index f5aafec4e..6f5266f47 100644 --- a/resources/Components/Gas/index.js +++ b/resources/Components/Gas/index.js @@ -1,4 +1,4 @@ -import React, { Component, useState } from 'react' +import { Component, useState } from 'react' import Restore from 'react-restore' import BigNumber from 'bignumber.js' @@ -64,7 +64,7 @@ const GasFeesMarket = ({ gasPrice, fees: { nextBaseFee, maxPriorityFeePerGas } } {displayBaseHint && (
The current base fee is added with a buffer to cover the next 3 blocks, any amount greater than your - block's base fee is refunded + block's base fee is refunded
)} {displayPriorityHint && ( diff --git a/resources/Components/Password/index.js b/resources/Components/Password/index.js index f67e685db..6575105e5 100644 --- a/resources/Components/Password/index.js +++ b/resources/Components/Password/index.js @@ -1,4 +1,3 @@ -import React from 'react' import { useRef, useState } from 'react' import zxcvbn from 'zxcvbn' diff --git a/resources/Components/RequestItem/index.js b/resources/Components/RequestItem/index.js index 90bc5b682..2510f0d8d 100644 --- a/resources/Components/RequestItem/index.js +++ b/resources/Components/RequestItem/index.js @@ -36,7 +36,7 @@ class _RequestItem extends React.Component { clearInterval(this.timer) } render() { - const { account, handlerId, i, title, svgName, img, color, headerMode, txNonce, children } = this.props + const { account, handlerId, title, svgName, img, color, headerMode, children } = this.props const req = this.store('main.accounts', account, 'requests', handlerId) let requestItemDetailsClass = 'requestItemDetails' diff --git a/resources/colors/index.ts b/resources/colors/index.ts index f2ee00ef9..634bdf339 100644 --- a/resources/colors/index.ts +++ b/resources/colors/index.ts @@ -22,6 +22,11 @@ const dark: ColorwayPalette = { accent8: { r: 60, g: 40, b: 234 } } +export enum Colorway { + light = 'light', + dark = 'dark' +} + const colorways: Record = { light, dark } function toHex(color: number) { diff --git a/resources/domain/request/index.ts b/resources/domain/request/index.ts index 8c9ae92c6..906b0cb95 100644 --- a/resources/domain/request/index.ts +++ b/resources/domain/request/index.ts @@ -1,3 +1,3 @@ -export const isCancelableRequest = (status: string): Boolean => { +export const isCancelableRequest = (status: string): boolean => { return !['sent', 'sending', 'verifying', 'confirming', 'confirmed', 'error', 'declined'].includes(status) } diff --git a/resources/link/index.js b/resources/link/index.js index fbead5987..300f60751 100644 --- a/resources/link/index.js +++ b/resources/link/index.js @@ -20,7 +20,7 @@ link.send = (...args) => { window.postMessage(wrap({ args, source, method: 'event' }), '*') } link.invoke = (...args) => { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { const id = v4() handlers[id] = resolve window.postMessage(wrap({ id, args, source, method: 'invoke' }), '*') diff --git a/resources/store/actions.panel.js b/resources/store/actions.panel.js index f35a89aa8..4280e5756 100644 --- a/resources/store/actions.panel.js +++ b/resources/store/actions.panel.js @@ -37,10 +37,10 @@ module.exports = { togglePanel: (u) => u('panel.show', (show) => !show), panelRequest: (u, request) => { request.host = request.host || new URL(request.url).host - u('panel.request', (v) => request) - u('panel.show', (v) => true) + u('panel.request', () => request) + u('panel.show', () => true) }, - setBalance: (u, account, balance) => u('balances', account, (b) => balance), + setBalance: (u, account, balance) => u('balances', account, () => balance), notify: (u, type, data = {}) => { u('view.notify', () => type) u('view.notifyData', () => data) @@ -88,7 +88,7 @@ module.exports = { unsetSigner: (u) => { u('selected.minimized', () => true) u('selected.open', () => false) - resetSigner(u) + this.resetSigner(u) setTimeout(() => { u('selected', (signer) => { signer.last = signer.current @@ -118,7 +118,7 @@ module.exports = { list.push(id) return list }) - u('view.data', id, (view) => ({ url: 'https://www.google.com/', title: 'New Tab' })) + u('view.data', id, () => ({ url: 'https://www.google.com/', title: 'New Tab' })) }, removeView: (u, id, isCurrent) => { u('view', (view) => { diff --git a/resources/svg/index.js b/resources/svg/index.js index 73f0bf233..438b2650c 100644 --- a/resources/svg/index.js +++ b/resources/svg/index.js @@ -1,4 +1,3 @@ -import React from 'react' import Octicon, { getIconByName } from '@githubprimer/octicons-react' export default { @@ -63,12 +62,12 @@ export default {
) }, - txSection: (size) => { + txSection: () => { return (
@@ -76,18 +75,6 @@ export default {
) }, - seedling: (size) => { - return ( -
- - - -
- ) - }, hex: (size) => { return (
@@ -100,7 +87,7 @@ export default {
) }, - swoop: (size) => { + swoop: () => { return (
@@ -665,35 +652,23 @@ export default {
- + - - -
- ) - }, - window: (size) => { - return ( -
- - +
) @@ -1102,7 +1077,7 @@ export default {
) }, - sine: (size) => { + sine: () => { return (
diff --git a/resources/utils/index.ts b/resources/utils/index.ts index b19b32b36..55b099786 100644 --- a/resources/utils/index.ts +++ b/resources/utils/index.ts @@ -56,7 +56,7 @@ function getErrorCode(e: Error) { return e.code } -const matchFilter = (filter: string = '', properties: string[] = []) => { +const matchFilter = (filter = '', properties: string[] = []) => { if (!filter) return true const filterItems = filter.split(' ') diff --git a/scripts/run-dev.mjs b/scripts/run-dev.mjs index 193a440a8..f33a303e0 100644 --- a/scripts/run-dev.mjs +++ b/scripts/run-dev.mjs @@ -42,7 +42,7 @@ function launchFrame({ shutdown }) { } async function run() { - const [env, server] = await Promise.all([prepareEnvironment(), launchDevServer()]) + const [_env, server] = await Promise.all([prepareEnvironment(), launchDevServer()]) launchFrame(server) } diff --git a/test/app/dash/Accounts/Add/AddAddress/index.test.js b/test/app/dash/Accounts/Add/AddAddress/index.test.js index c82eeb48d..6c1a834dc 100644 --- a/test/app/dash/Accounts/Add/AddAddress/index.test.js +++ b/test/app/dash/Accounts/Add/AddAddress/index.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import store from '../../../../../../main/store' diff --git a/test/app/dash/Accounts/Add/AddPhrase/index.test.js b/test/app/dash/Accounts/Add/AddPhrase/index.test.js index 911eb4af6..02d86c7b4 100644 --- a/test/app/dash/Accounts/Add/AddPhrase/index.test.js +++ b/test/app/dash/Accounts/Add/AddPhrase/index.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import { screen, render } from '../../../../../componentSetup' diff --git a/test/app/dash/Accounts/Add/AddRing/index.test.js b/test/app/dash/Accounts/Add/AddRing/index.test.js index bf4a5c04c..777eea247 100644 --- a/test/app/dash/Accounts/Add/AddRing/index.test.js +++ b/test/app/dash/Accounts/Add/AddRing/index.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import { render, screen } from '../../../../../componentSetup' diff --git a/test/app/dash/Chains/Chain/add.test.js b/test/app/dash/Chains/Chain/add.test.js index edf1ada89..fe1821365 100644 --- a/test/app/dash/Chains/Chain/add.test.js +++ b/test/app/dash/Chains/Chain/add.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import store from '../../../../../main/store' diff --git a/test/app/dash/Chains/Chain/expand.test.js b/test/app/dash/Chains/Chain/expand.test.js index 23902026e..e110d8a67 100644 --- a/test/app/dash/Chains/Chain/expand.test.js +++ b/test/app/dash/Chains/Chain/expand.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import store from '../../../../../main/store' diff --git a/test/app/dash/Tokens/AddToken/index.test.js b/test/app/dash/Tokens/AddToken/index.test.js index febbbe4c7..7c3b2ebfd 100644 --- a/test/app/dash/Tokens/AddToken/index.test.js +++ b/test/app/dash/Tokens/AddToken/index.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import { screen, render, waitFor } from '../../../../componentSetup' diff --git a/test/app/onboard/App/Slides/Proceed/index.test.js b/test/app/onboard/App/Slides/Proceed/index.test.js index 0561b6d6e..6279a01bb 100644 --- a/test/app/onboard/App/Slides/Proceed/index.test.js +++ b/test/app/onboard/App/Slides/Proceed/index.test.js @@ -1,5 +1,3 @@ -import React from 'react' - import { render, screen } from '../../../../../componentSetup' import Proceed from '../../../../../../app/onboard/App/Slides/Proceed' diff --git a/test/app/tray/Account/Requests/TransactionRequest/AdjustFee/index.test.js b/test/app/tray/Account/Requests/TransactionRequest/AdjustFee/index.test.js index 871367bdf..365b55eb8 100644 --- a/test/app/tray/Account/Requests/TransactionRequest/AdjustFee/index.test.js +++ b/test/app/tray/Account/Requests/TransactionRequest/AdjustFee/index.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import { addHexPrefix } from '@ethereumjs/util' import BigNumber from 'bignumber.js' diff --git a/test/app/tray/Account/Requests/TransactionRequest/TokenSpend/index.test.js b/test/app/tray/Account/Requests/TransactionRequest/TokenSpend/index.test.js index 76619af6b..c19523c39 100644 --- a/test/app/tray/Account/Requests/TransactionRequest/TokenSpend/index.test.js +++ b/test/app/tray/Account/Requests/TransactionRequest/TokenSpend/index.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import { addHexPrefix } from '@ethereumjs/util' diff --git a/test/app/tray/Account/Requests/TransactionRequest/TxFee/index.test.js b/test/app/tray/Account/Requests/TransactionRequest/TxFee/index.test.js index 9b9344746..4aa983fa6 100644 --- a/test/app/tray/Account/Requests/TransactionRequest/TxFee/index.test.js +++ b/test/app/tray/Account/Requests/TransactionRequest/TxFee/index.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import { addHexPrefix } from '@ethereumjs/util' diff --git a/test/app/tray/Account/Requests/TransactionRequest/index.test.js b/test/app/tray/Account/Requests/TransactionRequest/index.test.js index 06a1c09a1..6ee0dcb2a 100644 --- a/test/app/tray/Account/Requests/TransactionRequest/index.test.js +++ b/test/app/tray/Account/Requests/TransactionRequest/index.test.js @@ -1,4 +1,3 @@ -import React from 'react' import Restore from 'react-restore' import store from '../../../../../../main/store' diff --git a/test/e2e/index.test.js b/test/e2e/index.test.js index fed8116d1..e5b3f9b42 100644 --- a/test/e2e/index.test.js +++ b/test/e2e/index.test.js @@ -1,5 +1,3 @@ -/* globals test expect */ - const Web3 = require('web3') const web3 = new Web3(new Web3.providers.WebsocketProvider('ws://localhost:1248')) diff --git a/test/e2e/txWarnings.test.js b/test/e2e/txWarnings.test.js index 7ec19eee2..c09e2c35c 100644 --- a/test/e2e/txWarnings.test.js +++ b/test/e2e/txWarnings.test.js @@ -1,5 +1,3 @@ -/* global test */ - const provider = require('eth-provider') const frame = provider('frame') diff --git a/test/main/externalData/balances/reducers.test.js b/test/main/externalData/balances/reducers.test.js index 7e2c980e8..a77e3fc03 100644 --- a/test/main/externalData/balances/reducers.test.js +++ b/test/main/externalData/balances/reducers.test.js @@ -1,4 +1,4 @@ -import { groupByChain, mergeLists } from '../../../../main/externalData/balances/reducers' +import { groupByChain } from '../../../../main/externalData/balances/reducers' describe('#groupByChain', () => { it('groups tokens by chain', () => { diff --git a/test/main/provider/helpers.test.js b/test/main/provider/helpers.test.js index 36905d5f5..cebe0957c 100644 --- a/test/main/provider/helpers.test.js +++ b/test/main/provider/helpers.test.js @@ -1,10 +1,8 @@ import log from 'electron-log' import { fromUtf8 } from '@ethereumjs/util' -import { getRawTx, getSignedAddress, processTxForGasFees } from '../../../main/provider/helpers' -import store from '../../../main/store' -import { GasFeesSource } from '../../../resources/domain/transaction' +import { getRawTx, getSignedAddress } from '../../../main/provider/helpers' -jest.mock('../../../main/store') +jest.mock('../../../main/store/persist') beforeAll(async () => { log.transports.console.level = false diff --git a/test/main/signers/hot/RingSigner/index.test.js b/test/main/signers/hot/RingSigner/index.test.js index 23bab7bb5..45d34e9d7 100644 --- a/test/main/signers/hot/RingSigner/index.test.js +++ b/test/main/signers/hot/RingSigner/index.test.js @@ -1,4 +1,3 @@ -/* globals test, expect, beforeAll, afterAll, describe */ import fs from 'fs' import path from 'path' import crypto from 'crypto' diff --git a/test/main/signers/hot/SeedSigner/index.test.js b/test/main/signers/hot/SeedSigner/index.test.js index 7c13cb480..440eb1375 100644 --- a/test/main/signers/hot/SeedSigner/index.test.js +++ b/test/main/signers/hot/SeedSigner/index.test.js @@ -1,4 +1,3 @@ -/* globals test, expect, beforeAll, afterAll, describe */ import path from 'path' import { remove } from 'fs-extra' import { generateMnemonic } from 'bip39' diff --git a/test/main/signers/lattice/Lattice/index.test.js b/test/main/signers/lattice/Lattice/index.test.js index 8808b35c1..93ff053b7 100644 --- a/test/main/signers/lattice/Lattice/index.test.js +++ b/test/main/signers/lattice/Lattice/index.test.js @@ -376,7 +376,7 @@ describe('#deriveAddresses', () => { it('retries on failure', (done) => { let requestNum = 0 - lattice.connection.getAddresses.mockImplementation(async (opts) => { + lattice.connection.getAddresses.mockImplementation(async () => { if ((requestNum += 1) === 1) { throw new Error('Error from device: Getting addresses failed') } diff --git a/test/main/store/actions/index.test.js b/test/main/store/actions/index.test.js index 9e635e7b6..15f236e50 100644 --- a/test/main/store/actions/index.test.js +++ b/test/main/store/actions/index.test.js @@ -1208,7 +1208,7 @@ describe('#navClearReq', () => { } ] - const [req1, req2, inbox] = nav + const [req1, , inbox] = nav clearRequest('2b') diff --git a/test/main/transaction/gasMonitor.test.js b/test/main/transaction/gasMonitor.test.js index 4c5df33f4..8961fe600 100644 --- a/test/main/transaction/gasMonitor.test.js +++ b/test/main/transaction/gasMonitor.test.js @@ -1,6 +1,5 @@ import { intToHex } from '@ethereumjs/util' import GasMonitor from '../../../main/transaction/gasMonitor' -import { gweiToHex } from '../../util' let requestHandlers let testConnection = { diff --git a/test/resources/Components/Confirm/index.test.js b/test/resources/Components/Confirm/index.test.js index 01ab92dfe..4278ddf8a 100644 --- a/test/resources/Components/Confirm/index.test.js +++ b/test/resources/Components/Confirm/index.test.js @@ -1,5 +1,3 @@ -import React from 'react' - import { screen, render } from '../../../componentSetup' import Confirm from '../../../../resources/Components/Confirm' diff --git a/test/resources/Components/DisplayValue/index.test.js b/test/resources/Components/DisplayValue/index.test.js index 6c8a12dc3..664b2cb81 100644 --- a/test/resources/Components/DisplayValue/index.test.js +++ b/test/resources/Components/DisplayValue/index.test.js @@ -1,5 +1,3 @@ -import React from 'react' - import { render, screen } from '../../../componentSetup' import { DisplayValue } from '../../../../resources/Components/DisplayValue' import { displayValueData } from '../../../../resources/utils/displayValue' diff --git a/test/resources/Components/Password/index.test.js b/test/resources/Components/Password/index.test.js index 3b898420c..0538d8e99 100644 --- a/test/resources/Components/Password/index.test.js +++ b/test/resources/Components/Password/index.test.js @@ -1,5 +1,3 @@ -import React from 'react' - import { screen, render } from '../../../componentSetup' import { CreatePassword, ConfirmPassword } from '../../../../resources/Components/Password' diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 000000000..9dab91096 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig", + "exclude": ["**/__mocks__/*"] +} diff --git a/tsconfig.json b/tsconfig.json index c39171371..5d9e417bf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,7 +21,6 @@ "./resources/**/*.ts", "./resources/**/*.js" ], - "exclude": ["**/__mocks__/*"], "watchOptions": { "excludeFiles": ["./node_modules/**/*", "./package.json"] }