From b94bede473974ae680f90165f6d425bc573c7103 Mon Sep 17 00:00:00 2001 From: HenryNguyen5 Date: Wed, 18 Oct 2017 22:29:49 -0400 Subject: [PATCH] Add "No Unused Params and Locals" Linting Rule (#297) Add "No Unused Params and Locals" Linting Rule --- common/actions/ens/actionTypes.ts | 2 -- common/actions/rates/actionCreators.ts | 2 +- common/components/Footer/index.tsx | 2 +- .../Header/components/Navigation.tsx | 1 - .../DeterministicWalletsModal.tsx | 23 ++++++++----------- common/components/WalletDecrypt/Mnemonic.tsx | 11 ++++----- common/components/ui/Code.tsx | 2 +- common/components/ui/ColorDropdown.tsx | 2 -- common/components/ui/Dropdown.tsx | 2 +- common/components/ui/Help.tsx | 1 - common/containers/Tabs/ENS/index.tsx | 2 +- common/libs/erc20.ts | 2 +- common/libs/nodes/infura/client.ts | 1 - common/libs/transaction.ts | 2 +- common/libs/wallet/trezor.ts | 2 +- common/reducers/config.ts | 12 ++++------ common/reducers/rates.ts | 11 +++------ common/sagas/config.ts | 6 +---- common/sagas/swap/rates.ts | 2 +- common/utils/formatters.ts | 2 +- common/utils/localStorage.ts | 1 - tsconfig.json | 4 +++- 22 files changed, 37 insertions(+), 58 deletions(-) diff --git a/common/actions/ens/actionTypes.ts b/common/actions/ens/actionTypes.ts index 6489772a..d87a9445 100644 --- a/common/actions/ens/actionTypes.ts +++ b/common/actions/ens/actionTypes.ts @@ -1,5 +1,3 @@ -import * as constants from './constants'; - /*** Resolve ENS name ***/ export interface ResolveEnsNameAction { type: 'ENS_RESOLVE'; diff --git a/common/actions/rates/actionCreators.ts b/common/actions/rates/actionCreators.ts index 91ce5118..8725bf0b 100644 --- a/common/actions/rates/actionCreators.ts +++ b/common/actions/rates/actionCreators.ts @@ -1,6 +1,6 @@ import * as interfaces from './actionTypes'; import { TypeKeys } from './constants'; -import { fetchRates, CCResponse } from './actionPayloads'; +import { fetchRates } from './actionPayloads'; export type TFetchCCRates = typeof fetchCCRates; export function fetchCCRates(): interfaces.FetchCCRates { diff --git a/common/components/Footer/index.tsx b/common/components/Footer/index.tsx index 4101dbbc..4c5ae0b7 100644 --- a/common/components/Footer/index.tsx +++ b/common/components/Footer/index.tsx @@ -1,6 +1,6 @@ import logo from 'assets/images/logo-myetherwallet.svg'; import { bityReferralURL, donationAddressMap } from 'config/data'; -import React, { Component } from 'react'; +import React from 'react'; import translate from 'translations'; import './index.scss'; import PreFooter from './PreFooter'; diff --git a/common/components/Header/components/Navigation.tsx b/common/components/Header/components/Navigation.tsx index 339b1cb5..dd230aa7 100644 --- a/common/components/Header/components/Navigation.tsx +++ b/common/components/Header/components/Navigation.tsx @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types'; import React, { Component } from 'react'; import NavigationLink from './NavigationLink'; diff --git a/common/components/WalletDecrypt/DeterministicWalletsModal.tsx b/common/components/WalletDecrypt/DeterministicWalletsModal.tsx index 40e953d1..d87e41c3 100644 --- a/common/components/WalletDecrypt/DeterministicWalletsModal.tsx +++ b/common/components/WalletDecrypt/DeterministicWalletsModal.tsx @@ -7,7 +7,7 @@ import { SetDesiredTokenAction } from 'actions/deterministicWallets'; import Modal, { IButton } from 'components/ui/Modal'; -import { NetworkConfig, Token } from 'config/data'; +import { NetworkConfig } from 'config/data'; import { isValidPath } from 'libs/validators'; import React from 'react'; import { connect } from 'react-redux'; @@ -123,20 +123,21 @@ class DeterministicWalletsModal extends React.Component { onChange={this.handleChangePath} value={isCustomPath ? 'custom' : dPath} > - {dPaths.map(dp => + {dPaths.map(dp => ( - )} + ))} - {isCustomPath && + {isCustomPath && ( } + /> + )}
@@ -145,9 +146,7 @@ class DeterministicWalletsModal extends React.Component { # Address - - {network.unit} - + {network.unit} More @@ -280,9 +279,7 @@ class DeterministicWalletsModal extends React.Component { key={wallet.address} onClick={this.selectAddress.bind(this, wallet.address, wallet.index)} > - - {wallet.index + 1} - + {wallet.index + 1} { return (
-

- {translate('ADD_Radio_5')} -

+

{translate('ADD_Radio_5')}