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"]
}