Skip to content

Commit

Permalink
Linting fixes (#1470)
Browse files Browse the repository at this point in the history
Co-authored-by: goosewobbler <[email protected]>
  • Loading branch information
goosewobbler and goosewobbler authored Mar 16, 2023
1 parent 08add1a commit 5e6bcc4
Show file tree
Hide file tree
Showing 125 changed files with 169 additions and 435 deletions.
1 change: 1 addition & 0 deletions @types/frame/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/triple-slash-reference */
/// <reference path="./environment.d.ts" />
/// <reference path="./rpc.d.ts" />
/// <reference path="./restore.d.ts" />
Expand Down
5 changes: 0 additions & 5 deletions @types/frame/state.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions app/dapp/App.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from 'react'
import Restore from 'react-restore'

import DappTile from './DappTile'
import Native from '../../resources/Native'
import link from '../../resources/link'

class App extends React.Component {
constructor(...args) {
Expand Down Expand Up @@ -33,16 +31,6 @@ class App extends React.Component {
const sendDapp =
this.store('main.dapps', '0xe8d705c28f65bc3fe10df8b22f9daa265b99d0e1893b2df49fd38120f0410bca') || {}

const loaderStyle =
currentDapp && currentDapp.colors
? {
borderTop: `3px solid ${currentDapp.colors.backgroundShade}`,
borderRight: `3px solid ${currentDapp.colors.backgroundShade}`,
borderBottom: `3px solid ${currentDapp.colors.backgroundShade}`,
borderLeft: `3px solid ${currentDapp.colors.backgroundLight}`
}
: {}

return (
<div className='splash'>
<Native />
Expand Down
1 change: 0 additions & 1 deletion app/dapp/index.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
1 change: 0 additions & 1 deletion app/dash/Accounts/Add/AddHardwareLattice/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Restore from 'react-restore'
import Signer from '../../../Signer'

import link from '../../../../../resources/link'
import svg from '../../../../../resources/svg'
import RingIcon from '../../../../../resources/Components/RingIcon'

function parseDeviceName(name) {
Expand Down
2 changes: 1 addition & 1 deletion app/dash/Accounts/Add/AddKeystore/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import { AddHotAccount } from '../Components'
import link from '../../../../../resources/link'
import { PasswordInput } from '../../../../../resources/Components/Password'
Expand Down
2 changes: 0 additions & 2 deletions app/dash/Accounts/Add/AddPhrase/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

import { AddHotAccount } from '../Components'
import { utils } from 'ethers'

Expand Down
2 changes: 0 additions & 2 deletions app/dash/Accounts/Add/AddRing/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

import { AddHotAccount } from '../Components'
import { addHexPrefix, isHexString, isValidPrivate } from '@ethereumjs/util'

Expand Down
1 change: 0 additions & 1 deletion app/dash/Accounts/Add/Components/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { useState } from 'react'

import useFocusableRef from '../../../../../resources/Hooks/useFocusableRef'
Expand Down
2 changes: 0 additions & 2 deletions app/dash/Accounts/Add/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* globals Worker */

import React from 'react'
import Restore from 'react-restore'
import { Transition } from 'react-transition-group'
Expand Down
2 changes: 0 additions & 2 deletions app/dash/Accounts/Add/particleWorker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* globals self */

let canvas, ctx, looper
const particles = []
const particleCount = 56
Expand Down
7 changes: 4 additions & 3 deletions app/dash/Chains/Chain/ChainExpanded/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'
import { useState, useEffect } from 'react'

import link from '../../../../../resources/link'
import { Cluster } from '../../../../../resources/Components/Cluster'
Expand All @@ -17,7 +17,7 @@ import {
EditNativeCurrencyIcon
} from '../Components'

export default (props) => {
const ChainExpanded = (props) => {
// props
const {
id,
Expand All @@ -31,7 +31,6 @@ export default (props) => {
primaryColor,
icon,
nativeCurrencyIcon,
price,
nativeCurrencyName
} = props
const chain = { id, type, name, isTestnet, symbol, explorer, primaryColor }
Expand Down Expand Up @@ -125,3 +124,5 @@ export default (props) => {
</div>
)
}

export default ChainExpanded
2 changes: 1 addition & 1 deletion app/dash/Chains/Chain/ChainNew/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'

import chainDefault from '../chainDefault'
import link from '../../../../../resources/link'
Expand Down
7 changes: 4 additions & 3 deletions app/dash/Chains/Chain/ChainPreview/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react'
import { ChainHeader } from '../Components'
import Connection from '../Connection'
import Gas from '../../../../../resources/Components/Monitor'
import { ClusterBox, Cluster } from '../../../../../resources/Components/Cluster'

export default (props) => {
const { type, id, primaryColor, icon, name, on, explorer, symbol, price } = props
const ChainPreview = (props) => {
const { type, id, primaryColor, icon, name, on } = props
return (
<div className='network'>
<ChainHeader
Expand All @@ -32,3 +31,5 @@ export default (props) => {
</div>
)
}

export default ChainPreview
2 changes: 1 addition & 1 deletion app/dash/Chains/Chain/Components/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'

import link from '../../../../../resources/link'
import svg from '../../../../../resources/svg'
Expand Down
4 changes: 2 additions & 2 deletions app/dash/Command/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Command extends React.Component {
}
}
renderSignerTitle() {
const { view, data = {} } = this.store('windows.dash.nav')[0] || { view: '', data: {} }
const { data = {} } = this.store('windows.dash.nav')[0] || { view: '', data: {} }
const signer = data.signer ? this.store('main.signers', data.signer) : {}
if (!signer) return null
return (
Expand All @@ -30,7 +30,7 @@ class Command extends React.Component {
)
}
render() {
const { view, data } = this.store('windows.dash.nav')[0] || { view: '', data: {} }
const { view } = this.store('windows.dash.nav')[0] || { view: '', data: {} }
return (
<div className='command'>
{this.store('windows.dash.nav').length ? (
Expand Down
6 changes: 3 additions & 3 deletions app/dash/Settings/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useState, useEffect } from 'react'
import { Component } from 'react'
import Restore from 'react-restore'

import link from '../../../resources/link'
import Dropdown from '../../../resources/Components/Dropdown'
import { getSummonShortcut } from '../../../resources/app'

class Settings extends React.Component {
class Settings extends Component {
constructor(props, context) {
super(props, context)
const latticeEndpoint = context.store('main.latticeSettings.endpointCustom')
Expand Down Expand Up @@ -186,7 +186,7 @@ class Settings extends React.Component {
/>
</div>
<div className='signerPermissionDetails'>
<span>Set Frame's visual theme</span>
<span>Set Frame&apos;s visual theme</span>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/dash/Signer/SignerStatus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SignerStatus extends React.Component {
this.setState({ unlockInput: e.target.value })
}

unlockSubmit(e) {
unlockSubmit() {
link.rpc('unlockSigner', this.props.signer.id, this.state.unlockInput, (err) => {
if (err) this.shake()
})
Expand Down
8 changes: 2 additions & 6 deletions app/dash/Signer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,6 @@ class Signer extends React.Component {
const isLocked = !hwSigner && status === 'locked'
const permissionId = tag || tag === '' ? 'Frame' + (tag ? `-${tag}` : '') : undefined

let signerClass = 'signer'
if (status === 'ok') signerClass += ' signerOk'
if (isLocked) signerClass += ' signerLocked'

const zIndex = 1000 - index

return (
Expand All @@ -384,7 +380,7 @@ class Signer extends React.Component {
{this.statusText()}
{type === 'lattice' && status === 'pair' ? (
<div className='signerLatticePair'>
<div className='signerLatticePairTitle'>Please input your Lattice's pairing code</div>
<div className='signerLatticePairTitle'>Please input your Lattice&apos;s pairing code</div>
<div className='signerLatticePairInput'>
<input
autoFocus
Expand Down Expand Up @@ -464,7 +460,7 @@ class Signer extends React.Component {
<></>
)}
<div className='signerControls'>
{!!permissionId ? (
{permissionId ? (
<div className='signerControlDetail'>
<div className='signerControlDetailKey'>{'PERMISSION ID:'}</div>
<div className='signerControlDetailValue'>{permissionId}</div>
Expand Down
2 changes: 1 addition & 1 deletion app/dash/Tokens/AddToken/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isValidAddress } from '@ethereumjs/util'
import React, { Component, useEffect, useRef, useState } from 'react'
import { Component, useEffect, useRef, useState } from 'react'
import Restore from 'react-restore'
import RingIcon from '../../../../resources/Components/RingIcon'
import link from '../../../../resources/link'
Expand Down
1 change: 0 additions & 1 deletion app/dash/Tokens/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Restore from 'react-restore'

import AddToken from './AddToken'
Expand Down
1 change: 0 additions & 1 deletion app/dash/index.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
1 change: 0 additions & 1 deletion app/onboard/index.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion app/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import link from '../resources/link'

import * as actions from '../resources/store/actions.panel'

export default (state, cb) => {
export default (state, _cb) => {
const store = Restore.create(state, actions)
store.events = new EventEmitter()

Expand Down
7 changes: 0 additions & 7 deletions app/tray/Account/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,6 @@ class Account extends React.Component {
render() {
const minimized = this.store('selected.minimized')

const account = this.store('main.accounts', this.props.id)
let signer

if (account.signer) {
signer = this.store('main.signers', account.signer)
}

return (
<AccountBody
id={this.props.id}
Expand Down
10 changes: 1 addition & 9 deletions app/tray/Account/Balances/Balance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@ import RingIcon from '../../../../../resources/Components/RingIcon'
class Balance extends React.Component {
render() {
const { symbol, balance, i, scanning, chainId } = this.props
const {
priceChange,
decimals,
balance: balanceValue,
usdRate: currencyRate,
logoURI,
price,
displayBalance = '0'
} = balance
const { priceChange, decimals, balance: balanceValue, usdRate: currencyRate, logoURI } = balance
const change = parseFloat(priceChange)
const direction = change < 0 ? -1 : change > 0 ? 1 : 0
let priceChangeClass = 'signerBalanceCurrentPriceChange'
Expand Down
2 changes: 0 additions & 2 deletions app/tray/Account/Balances/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* globals ResizeObserver */

import React from 'react'
import Restore from 'react-restore'

Expand Down
4 changes: 2 additions & 2 deletions app/tray/Account/Chains/ChainsPreview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import link from '../../../../../resources/link'
import svg from '../../../../../resources/svg'
import Monitor from '../../../../../resources/Components/Monitor'

import { Cluster, ClusterRow, ClusterValue } from '../../../../../resources/Components/Cluster'
import { Cluster } from '../../../../../resources/Components/Cluster'

class ChainsPreview extends React.Component {
constructor(...args) {
Expand Down Expand Up @@ -57,7 +57,7 @@ class ChainsPreview extends React.Component {
const currentChainMeta = this.store('main.networksMeta.ethereum', currentChainId)
if (!currentChain || !currentChainMeta) return null
const { name } = currentChain
const { icon, primaryColor } = currentChainMeta
const { primaryColor } = currentChainMeta
return (
<div className='balancesBlock' ref={this.moduleRef}>
<div className='moduleHeader'>
Expand Down
3 changes: 0 additions & 3 deletions app/tray/Account/Inventory/InventoryExpanded/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ class Inventory extends React.Component {
const inventory = this.store('main.inventory', this.props.account)
const collections = Object.keys(inventory || {})
return collections
.filter((k) => {
return true
})
.sort((a, b) => {
const assetsLengthA = Object.keys(inventory[a].items).length
const assetsLengthB = Object.keys(inventory[b].items).length
Expand Down
2 changes: 1 addition & 1 deletion app/tray/Account/Inventory/InventoryPreview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import link from '../../../../../resources/link'
import svg from '../../../../../resources/svg'
import { matchFilter } from '../../../../../resources/utils'

import { ClusterBox, Cluster, ClusterRow, ClusterValue } from '../../../../../resources/Components/Cluster'
import { Cluster, ClusterRow, ClusterValue } from '../../../../../resources/Components/Cluster'

class Inventory extends React.Component {
constructor(...args) {
Expand Down
1 change: 0 additions & 1 deletion app/tray/Account/Requests/AddTokenRequest/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import Restore from 'react-restore'
import svg from '../../../../../resources/svg'
import link from '../../../../../resources/link'

class AddTokenRequest extends React.Component {
constructor(...args) {
Expand Down
1 change: 0 additions & 1 deletion app/tray/Account/Requests/ChainRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class ChainRequest extends React.Component {
if (status === 'pending') requestClass += ' signerRequestPending'
if (status === 'error') requestClass += ' signerRequestError'

const originName = this.store('main.origins', this.props.req.origin, 'name')
let originClass = 'requestProviderOrigin'
if (origin.length > 28) originClass = 'requestProviderOrigin requestProviderOrigin18'
if (origin.length > 36) originClass = 'requestProviderOrigin requestProviderOrigin12'
Expand Down
2 changes: 0 additions & 2 deletions app/tray/Account/Requests/Ens/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

const timeFormat = new Intl.DateTimeFormat('en', { dateStyle: 'medium' })

function formatTime(amount, unit) {
Expand Down
1 change: 0 additions & 1 deletion app/tray/Account/Requests/SignPermitRequest/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import BigNumber from 'bignumber.js'

import { isUnlimited } from '../../../../../resources/utils/numbers'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const FeeOverlayInput = ({ initialValue, labelText, tabIndex, decimals, onReceiv
className='txFeeOverlayInput'
aria-labelledby={labelId}
onChange={(e) => {
const parsedInput = (decimals ? /[0-9\.]*/ : /[0-9]*/).exec(e.target.value)
const parsedInput = (decimals ? /[0-9.]*/ : /[0-9]*/).exec(e.target.value)
const enteredValue = parsedInput[0] || ''

if (enteredValue === '.' || enteredValue === '') return setValue(enteredValue)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

const Destination = ({ chain, recipientType }) => {
const formattedRecipient = recipientType === 'contract' ? 'contract' : 'account'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Recipient from '../recipient'

const Register = ({ address, domain, copyAddress }) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

const Transfer = ({ symbol, displayValue, rate }) => {
return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'

import svg from '../../../../../../resources/svg'
import { getAddress } from '../../../../../../resources/utils'
Expand Down
Loading

0 comments on commit 5e6bcc4

Please sign in to comment.