diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-05 10:48:21 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-05 10:48:21 +0800 |
commit | 9778695b4ad1fd999eb79b01c768a2f2b9938917 (patch) | |
tree | 3c44cd0e16474966f88af5b75846c1d6b7521188 | |
parent | 70858603ed37de24ae47978a191b3f188f450182 (diff) | |
download | dexon-0x-contracts-9778695b4ad1fd999eb79b01c768a2f2b9938917.tar.gz dexon-0x-contracts-9778695b4ad1fd999eb79b01c768a2f2b9938917.tar.zst dexon-0x-contracts-9778695b4ad1fd999eb79b01c768a2f2b9938917.zip |
Try enabling no-unused-variable...
180 files changed, 110 insertions, 420 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts index 206954a0b..001f336e7 100644 --- a/packages/0x.js/src/0x.ts +++ b/packages/0x.js/src/0x.ts @@ -19,7 +19,6 @@ import { OrderWatcher, OrderWatcherConfig } from '@0xproject/order-watcher'; import { ECSignature, Order, Provider, SignedOrder, TransactionReceiptWithDecodedLogs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import * as _ from 'lodash'; import { constants } from './utils/constants'; diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts index a8cf62c64..e5c1429e5 100644 --- a/packages/0x.js/src/types.ts +++ b/packages/0x.js/src/types.ts @@ -1,15 +1,3 @@ -import { - BlockParam, - BlockParamLiteral, - ContractAbi, - ContractEventArg, - ExchangeContractErrs, - FilterObject, - LogWithDecodedArgs, - Order, - OrderState, - SignedOrder, -} from '@0xproject/types'; export enum InternalZeroExError { NoAbiDecoder = 'NO_ABI_DECODER', diff --git a/packages/0x.js/src/utils/constants.ts b/packages/0x.js/src/utils/constants.ts index 7cd5eb574..45bf1399c 100644 --- a/packages/0x.js/src/utils/constants.ts +++ b/packages/0x.js/src/utils/constants.ts @@ -1,4 +1,3 @@ -import { BigNumber } from '@0xproject/utils'; export const constants = { NULL_ADDRESS: '0x0000000000000000000000000000000000000000', diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts index 509d3f9f2..5d2eb6d7e 100644 --- a/packages/0x.js/test/0x.js_test.ts +++ b/packages/0x.js/test/0x.js_test.ts @@ -1,14 +1,12 @@ import { ContractWrappers } from '@0xproject/contract-wrappers'; -import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; import 'make-promises-safe'; import 'mocha'; -import * as path from 'path'; -import * as Sinon from 'sinon'; -import { ApprovalContractEventArgs, LogWithDecodedArgs, Order, TokenEvents, ZeroEx } from '../src'; +import { ApprovalContractEventArgs, LogWithDecodedArgs, TokenEvents, ZeroEx } from '../src'; import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; @@ -137,6 +135,7 @@ describe('ZeroEx library', () => { const proxyAddress = zeroEx.proxy.getContractAddress(); const txHash = await zeroEx.token.setUnlimitedProxyAllowanceAsync(zrxTokenAddress, coinbase); const txReceiptWithDecodedLogs = await zeroEx.awaitTransactionMinedAsync(txHash); + // tslint:disable-next-line:no-unnecessary-type-assertion const log = txReceiptWithDecodedLogs.logs[0] as LogWithDecodedArgs<ApprovalContractEventArgs>; expect(log.event).to.be.equal(TokenEvents.Approval); expect(log.args._owner).to.be.equal(coinbase); diff --git a/packages/0x.js/test/artifacts_test.ts b/packages/0x.js/test/artifacts_test.ts index 982fb8e63..fd7066aac 100644 --- a/packages/0x.js/test/artifacts_test.ts +++ b/packages/0x.js/test/artifacts_test.ts @@ -1,5 +1,4 @@ import { web3Factory } from '@0xproject/dev-utils'; -import * as fs from 'fs'; import 'make-promises-safe'; import { ZeroEx } from '../src'; diff --git a/packages/0x.js/test/global_hooks.ts b/packages/0x.js/test/global_hooks.ts index 6d2c3219b..9d6903af5 100644 --- a/packages/0x.js/test/global_hooks.ts +++ b/packages/0x.js/test/global_hooks.ts @@ -1,8 +1,6 @@ import { devConstants } from '@0xproject/dev-utils'; import { runV1MigrationsAsync } from '@0xproject/migrations'; -import * as path from 'path'; -import { constants } from './utils/constants'; import { provider } from './utils/web3_wrapper'; before('migrate contracts', async function(): Promise<void> { diff --git a/packages/0x.js/test/utils/web3_wrapper.ts b/packages/0x.js/test/utils/web3_wrapper.ts index 71a0dc1c2..f7d11f138 100644 --- a/packages/0x.js/test/utils/web3_wrapper.ts +++ b/packages/0x.js/test/utils/web3_wrapper.ts @@ -1,4 +1,4 @@ -import { devConstants, web3Factory } from '@0xproject/dev-utils'; +import { web3Factory } from '@0xproject/dev-utils'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index b7e6722ea..0d053cdd1 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -12,7 +12,7 @@ import * as yargs from 'yargs'; import toSnakeCase = require('to-snake-case'); -import { ContextData, ContractsBackend, Method, ParamKind } from './types'; +import { ContextData, ContractsBackend, ParamKind } from './types'; import { utils } from './utils'; const ABI_TYPE_CONSTRUCTOR = 'constructor'; diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index d9e28f9f2..96612f6b2 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -44,6 +44,7 @@ export class BaseContract { const constructorAbiIfExists = _.find( abi, (abiDefinition: AbiDefinition) => abiDefinition.type === AbiType.Constructor, + // tslint:disable-next-line:no-unnecessary-type-assertion ) as ConstructorAbi | undefined; if (!_.isUndefined(constructorAbiIfExists)) { return constructorAbiIfExists; diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts index 074ab950f..f5e52f50d 100644 --- a/packages/connect/src/types.ts +++ b/packages/connect/src/types.ts @@ -1,4 +1,4 @@ -import { Order, SignedOrder } from '@0xproject/types'; +import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; export interface Client { diff --git a/packages/connect/src/utils/relayer_response_json_parsers.ts b/packages/connect/src/utils/relayer_response_json_parsers.ts index cf1c07bd9..ccae8b115 100644 --- a/packages/connect/src/utils/relayer_response_json_parsers.ts +++ b/packages/connect/src/utils/relayer_response_json_parsers.ts @@ -1,7 +1,6 @@ import { assert } from '@0xproject/assert'; import { schemas } from '@0xproject/json-schemas'; import { SignedOrder } from '@0xproject/types'; -import * as _ from 'lodash'; import { FeesResponse, OrderbookResponse, TokenPairsItem } from '../types'; diff --git a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts index f255ced62..6ad0a5888 100644 --- a/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/contract_wrapper.ts @@ -7,7 +7,7 @@ import { LogWithDecodedArgs, RawLog, } from '@0xproject/types'; -import { AbiDecoder, intervalUtils } from '@0xproject/utils'; +import { intervalUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Block, BlockAndLogStreamer } from 'ethereumjs-blockstream'; import * as _ from 'lodash'; diff --git a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts index 1bd65270b..3c7c97bcc 100644 --- a/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts @@ -1,6 +1,6 @@ import { schemas } from '@0xproject/json-schemas'; import { LogWithDecodedArgs } from '@0xproject/types'; -import { AbiDecoder, BigNumber } from '@0xproject/utils'; +import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index fc177dd42..de2c64d23 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -8,12 +8,10 @@ import { LogEntry, LogWithDecodedArgs, Order, - OrderAddresses, OrderState, - OrderValues, SignedOrder, } from '@0xproject/types'; -import { AbiDecoder, BigNumber } from '@0xproject/utils'; +import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; @@ -35,7 +33,6 @@ import { assert } from '../utils/assert'; import { decorators } from '../utils/decorators'; import { ExchangeTransferSimulator } from '../utils/exchange_transfer_simulator'; import { OrderValidationUtils } from '../utils/order_validation_utils'; -import { utils } from '../utils/utils'; import { ContractWrapper } from './contract_wrapper'; import { diff --git a/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts index 844318c79..de82a0252 100644 --- a/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/token_wrapper.ts @@ -1,6 +1,6 @@ import { schemas } from '@0xproject/json-schemas'; import { LogWithDecodedArgs } from '@0xproject/types'; -import { AbiDecoder, BigNumber } from '@0xproject/utils'; +import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; diff --git a/packages/contract-wrappers/src/types.ts b/packages/contract-wrappers/src/types.ts index 9a463d635..969b58aa3 100644 --- a/packages/contract-wrappers/src/types.ts +++ b/packages/contract-wrappers/src/types.ts @@ -2,11 +2,7 @@ import { BigNumber } from '@0xproject/utils'; import { BlockParam, - BlockParamLiteral, - ContractAbi, ContractEventArg, - ExchangeContractErrs, - FilterObject, LogEntryEvent, LogWithDecodedArgs, Order, diff --git a/packages/contract-wrappers/src/utils/assert.ts b/packages/contract-wrappers/src/utils/assert.ts index c74ed341f..bc4114d56 100644 --- a/packages/contract-wrappers/src/utils/assert.ts +++ b/packages/contract-wrappers/src/utils/assert.ts @@ -4,9 +4,7 @@ import { assert as sharedAssert } from '@0xproject/assert'; import { Schema } from '@0xproject/json-schemas'; // tslint:disable-next-line:no-unused-variable import { ECSignature } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import * as _ from 'lodash'; import { isValidSignature } from '@0xproject/order-utils'; diff --git a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts index b575285a1..395945fe3 100644 --- a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts +++ b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts @@ -1,6 +1,5 @@ import { BlockParamLiteral, ExchangeContractErrs } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; import { TokenWrapper } from '../contract_wrappers/token_wrapper'; import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store'; diff --git a/packages/contract-wrappers/src/utils/filter_utils.ts b/packages/contract-wrappers/src/utils/filter_utils.ts index 4ec9e256b..0dab61c02 100644 --- a/packages/contract-wrappers/src/utils/filter_utils.ts +++ b/packages/contract-wrappers/src/utils/filter_utils.ts @@ -1,11 +1,8 @@ import { - ConstructorAbi, ContractAbi, EventAbi, - FallbackAbi, FilterObject, LogEntry, - MethodAbi, } from '@0xproject/types'; import * as ethUtil from 'ethereumjs-util'; import * as jsSHA3 from 'js-sha3'; diff --git a/packages/contract-wrappers/src/utils/order_validation_utils.ts b/packages/contract-wrappers/src/utils/order_validation_utils.ts index 362c605de..b6b3334a6 100644 --- a/packages/contract-wrappers/src/utils/order_validation_utils.ts +++ b/packages/contract-wrappers/src/utils/order_validation_utils.ts @@ -4,7 +4,7 @@ import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper'; -import { ContractWrappersError, TradeSide, TransferType } from '../types'; +import { TradeSide, TransferType } from '../types'; import { constants } from '../utils/constants'; import { utils } from '../utils/utils'; diff --git a/packages/contract-wrappers/test/artifacts_test.ts b/packages/contract-wrappers/test/artifacts_test.ts index eaaa89c48..34e6bbde8 100644 --- a/packages/contract-wrappers/test/artifacts_test.ts +++ b/packages/contract-wrappers/test/artifacts_test.ts @@ -1,5 +1,4 @@ import { web3Factory } from '@0xproject/dev-utils'; -import * as fs from 'fs'; import 'make-promises-safe'; import { ContractWrappers } from '../src'; diff --git a/packages/contract-wrappers/test/ether_token_wrapper_test.ts b/packages/contract-wrappers/test/ether_token_wrapper_test.ts index a2154c2bd..d08f26c53 100644 --- a/packages/contract-wrappers/test/ether_token_wrapper_test.ts +++ b/packages/contract-wrappers/test/ether_token_wrapper_test.ts @@ -1,4 +1,4 @@ -import { BlockchainLifecycle, callbackErrorReporter, devConstants, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { DoneCallback } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; diff --git a/packages/contract-wrappers/test/exchange_transfer_simulator_test.ts b/packages/contract-wrappers/test/exchange_transfer_simulator_test.ts index cf7520ea0..8bbe04d6c 100644 --- a/packages/contract-wrappers/test/exchange_transfer_simulator_test.ts +++ b/packages/contract-wrappers/test/exchange_transfer_simulator_test.ts @@ -1,4 +1,4 @@ -import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { BlockParamLiteral, Token } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts index d35d2b819..a418f5f22 100644 --- a/packages/contract-wrappers/test/exchange_wrapper_test.ts +++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts @@ -1,11 +1,10 @@ -import { BlockchainLifecycle, callbackErrorReporter, devConstants, web3Factory } from '@0xproject/dev-utils'; +import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; import { getOrderHashHex } from '@0xproject/order-utils'; import { BlockParamLiteral, DoneCallback, OrderState } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; -import * as _ from 'lodash'; import 'make-promises-safe'; import 'mocha'; diff --git a/packages/contract-wrappers/test/global_hooks.ts b/packages/contract-wrappers/test/global_hooks.ts index 6d2c3219b..9d6903af5 100644 --- a/packages/contract-wrappers/test/global_hooks.ts +++ b/packages/contract-wrappers/test/global_hooks.ts @@ -1,8 +1,6 @@ import { devConstants } from '@0xproject/dev-utils'; import { runV1MigrationsAsync } from '@0xproject/migrations'; -import * as path from 'path'; -import { constants } from './utils/constants'; import { provider } from './utils/web3_wrapper'; before('migrate contracts', async function(): Promise<void> { diff --git a/packages/contract-wrappers/test/order_validation_test.ts b/packages/contract-wrappers/test/order_validation_test.ts index a14dc24b6..a42a6a368 100644 --- a/packages/contract-wrappers/test/order_validation_test.ts +++ b/packages/contract-wrappers/test/order_validation_test.ts @@ -1,4 +1,4 @@ -import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; import { OrderError } from '@0xproject/order-utils'; import { BlockParamLiteral } from '@0xproject/types'; @@ -7,7 +7,7 @@ import * as chai from 'chai'; import 'make-promises-safe'; import * as Sinon from 'sinon'; -import { ContractWrappers, ContractWrappersError, ExchangeContractErrs, SignedOrder, Token } from '../src'; +import { ContractWrappers, ExchangeContractErrs, SignedOrder, Token } from '../src'; import { TradeSide, TransferType } from '../src/types'; import { ExchangeTransferSimulator } from '../src/utils/exchange_transfer_simulator'; import { OrderValidationUtils } from '../src/utils/order_validation_utils'; diff --git a/packages/contract-wrappers/test/subscription_test.ts b/packages/contract-wrappers/test/subscription_test.ts index 65c76e47f..3232fd03c 100644 --- a/packages/contract-wrappers/test/subscription_test.ts +++ b/packages/contract-wrappers/test/subscription_test.ts @@ -1,4 +1,4 @@ -import { BlockchainLifecycle, callbackErrorReporter, devConstants } from '@0xproject/dev-utils'; +import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { DoneCallback } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; diff --git a/packages/contract-wrappers/test/token_registry_wrapper_test.ts b/packages/contract-wrappers/test/token_registry_wrapper_test.ts index 0e9ddd245..e2881d022 100644 --- a/packages/contract-wrappers/test/token_registry_wrapper_test.ts +++ b/packages/contract-wrappers/test/token_registry_wrapper_test.ts @@ -1,4 +1,4 @@ -import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils'; +import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { schemas, SchemaValidator } from '@0xproject/json-schemas'; import * as chai from 'chai'; import * as _ from 'lodash'; diff --git a/packages/contract-wrappers/test/token_wrapper_test.ts b/packages/contract-wrappers/test/token_wrapper_test.ts index 12bf72d85..d0632bd5f 100644 --- a/packages/contract-wrappers/test/token_wrapper_test.ts +++ b/packages/contract-wrappers/test/token_wrapper_test.ts @@ -1,4 +1,4 @@ -import { BlockchainLifecycle, callbackErrorReporter, devConstants } from '@0xproject/dev-utils'; +import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { EmptyWalletSubprovider } from '@0xproject/subproviders'; import { DoneCallback, Provider } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; diff --git a/packages/contract-wrappers/test/utils/web3_wrapper.ts b/packages/contract-wrappers/test/utils/web3_wrapper.ts index 71a0dc1c2..f7d11f138 100644 --- a/packages/contract-wrappers/test/utils/web3_wrapper.ts +++ b/packages/contract-wrappers/test/utils/web3_wrapper.ts @@ -1,4 +1,4 @@ -import { devConstants, web3Factory } from '@0xproject/dev-utils'; +import { web3Factory } from '@0xproject/dev-utils'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; diff --git a/packages/dev-utils/src/blockchain_lifecycle.ts b/packages/dev-utils/src/blockchain_lifecycle.ts index 3e35de861..cb448243a 100644 --- a/packages/dev-utils/src/blockchain_lifecycle.ts +++ b/packages/dev-utils/src/blockchain_lifecycle.ts @@ -1,5 +1,4 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import * as Web3 from 'web3'; export class BlockchainLifecycle { private _web3Wrapper: Web3Wrapper; diff --git a/packages/dev-utils/src/web3_factory.ts b/packages/dev-utils/src/web3_factory.ts index 12872c122..4e30007a7 100644 --- a/packages/dev-utils/src/web3_factory.ts +++ b/packages/dev-utils/src/web3_factory.ts @@ -7,10 +7,8 @@ import ProviderEngine = require('web3-provider-engine'); import RpcSubprovider = require('web3-provider-engine/subproviders/rpc'); import { EmptyWalletSubprovider, FakeGasEstimateSubprovider, GanacheSubprovider } from '@0xproject/subproviders'; -import { Provider } from 'ethereum-types'; import * as fs from 'fs'; import * as _ from 'lodash'; -import * as process from 'process'; import { constants } from './constants'; import { env, EnvVars } from './env'; diff --git a/packages/dev-utils/test/blockchain_lifecycle_test.ts b/packages/dev-utils/test/blockchain_lifecycle_test.ts index 3d7d2e0ef..18e245aa3 100644 --- a/packages/dev-utils/test/blockchain_lifecycle_test.ts +++ b/packages/dev-utils/test/blockchain_lifecycle_test.ts @@ -1,6 +1,5 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; -import { BlockParamLiteral } from 'ethereum-types'; import 'make-promises-safe'; import 'mocha'; @@ -18,6 +17,7 @@ describe('BlockchainLifecycle tests', () => { await blockchainLifecycle.startAsync(); await web3Wrapper.mineBlockAsync(); const blockNumberAfter = await web3Wrapper.getBlockNumberAsync(); + // tslint:disable-next-line:restrict-plus-operands expect(blockNumberAfter).to.be.equal(blockNumberBefore + 1); await blockchainLifecycle.revertAsync(); const blockNumberAfterRevert = await web3Wrapper.getBlockNumberAsync(); diff --git a/packages/dev-utils/test/rpc_test.ts b/packages/dev-utils/test/rpc_test.ts index cff946e23..68842ed3a 100644 --- a/packages/dev-utils/test/rpc_test.ts +++ b/packages/dev-utils/test/rpc_test.ts @@ -16,6 +16,7 @@ describe('RPC tests', () => { const blockNumberBefore = await web3Wrapper.getBlockNumberAsync(); await web3Wrapper.mineBlockAsync(); const blockNumberAfter = await web3Wrapper.getBlockNumberAsync(); + // tslint:disable-next-line:restrict-plus-operands expect(blockNumberAfter).to.be.equal(blockNumberBefore + 1); }); }); @@ -26,6 +27,7 @@ describe('RPC tests', () => { await web3Wrapper.increaseTimeAsync(TIME_DELTA); await web3Wrapper.mineBlockAsync(); const blockTimestampAfter = await web3Wrapper.getBlockTimestampAsync(BlockParamLiteral.Latest); + // tslint:disable-next-line:restrict-plus-operands expect(blockTimestampAfter).to.be.at.least(blockTimestampBefore + TIME_DELTA); }); }); diff --git a/packages/fill-scenarios/tslint.json b/packages/fill-scenarios/tslint.json index ffaefe83a..4da19578a 100644 --- a/packages/fill-scenarios/tslint.json +++ b/packages/fill-scenarios/tslint.json @@ -1,3 +1,6 @@ { - "extends": ["@0xproject/tslint-config"] + "extends": ["@0xproject/tslint-config"], + "rules": { + "no-unused-variable": false + } } diff --git a/packages/metacoin/test/metacoin_test.ts b/packages/metacoin/test/metacoin_test.ts index 3436fb49e..09e0d6b36 100644 --- a/packages/metacoin/test/metacoin_test.ts +++ b/packages/metacoin/test/metacoin_test.ts @@ -1,7 +1,6 @@ import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils'; import { ContractArtifact } from '@0xproject/sol-compiler'; import { BigNumber } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; import 'make-promises-safe'; @@ -18,7 +17,7 @@ const artifact: ContractArtifact = MetacoinArtifact as any; chaiSetup.configure(); const { expect } = chai; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); - +// tslint:disable:no-unnecessary-type-assertion describe('Metacoin', () => { let metacoin: MetacoinContract; const ownerAddress = devConstants.TESTRPC_FIRST_ADDRESS; @@ -116,3 +115,4 @@ describe('Metacoin', () => { }); }); }); +// tslint:enable:no-unnecessary-type-assertion diff --git a/packages/metacoin/test/utils/config.ts b/packages/metacoin/test/utils/config.ts index ef4932845..c26fe5f25 100644 --- a/packages/metacoin/test/utils/config.ts +++ b/packages/metacoin/test/utils/config.ts @@ -1,5 +1,4 @@ import { devConstants } from '@0xproject/dev-utils'; -import * as path from 'path'; export const config = { networkId: 50, diff --git a/packages/metacoin/test/utils/web3_wrapper.ts b/packages/metacoin/test/utils/web3_wrapper.ts index 724ed4e1f..273cdf961 100644 --- a/packages/metacoin/test/utils/web3_wrapper.ts +++ b/packages/metacoin/test/utils/web3_wrapper.ts @@ -2,7 +2,6 @@ import { env, EnvVars } from '@0xproject/dev-utils'; import { GanacheSubprovider, prependSubprovider } from '@0xproject/subproviders'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as fs from 'fs'; -import * as _ from 'lodash'; import ProviderEngine = require('web3-provider-engine'); import { config } from './config'; diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts index a6fd86e5a..5f320ec78 100644 --- a/packages/migrations/src/migrate.ts +++ b/packages/migrations/src/migrate.ts @@ -2,7 +2,6 @@ import { devConstants, web3Factory } from '@0xproject/dev-utils'; import { logUtils } from '@0xproject/utils'; import { Provider } from 'ethereum-types'; -import * as path from 'path'; import * as yargs from 'yargs'; import { runV1MigrationsAsync } from './v1/migration'; diff --git a/packages/migrations/src/v1/migration.ts b/packages/migrations/src/v1/migration.ts index baa776537..7c1cda506 100644 --- a/packages/migrations/src/v1/migration.ts +++ b/packages/migrations/src/v1/migration.ts @@ -1,10 +1,8 @@ import { BigNumber, NULL_BYTES } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Provider, TxData } from 'ethereum-types'; -import * as _ from 'lodash'; import { ArtifactWriter } from '../artifact_writer'; -import { ContractName } from '../types'; import { erc20TokenInfo } from '../utils/token_info'; import { artifacts } from './artifacts'; diff --git a/packages/migrations/src/v2/migration.ts b/packages/migrations/src/v2/migration.ts index 08a8ad2a7..d517486ed 100644 --- a/packages/migrations/src/v2/migration.ts +++ b/packages/migrations/src/v2/migration.ts @@ -1,10 +1,8 @@ -import { BigNumber, NULL_BYTES } from '@0xproject/utils'; +import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Provider, TxData } from 'ethereum-types'; -import * as _ from 'lodash'; import { ArtifactWriter } from '../artifact_writer'; -import { ContractName } from '../types'; import { erc20TokenInfo, erc721TokenInfo } from '../utils/token_info'; import { artifacts } from './artifacts'; @@ -96,6 +94,7 @@ export const runV2MigrationsAsync = async (provider: Provider, artifactsDir: str // Dummy ERC20 tokens for (const token of erc20TokenInfo) { const totalSupply = new BigNumber(100000000000000000000); + // tslint:disable-next-line:no-unused-variable const dummyErc20Token = await DummyERC20TokenContract.deployFrom0xArtifactAsync( artifacts.DummyERC20Token, provider, @@ -108,6 +107,7 @@ export const runV2MigrationsAsync = async (provider: Provider, artifactsDir: str } // ERC721 + // tslint:disable-next-line:no-unused-variable const cryptoKittieToken = await DummyERC721TokenContract.deployFrom0xArtifactAsync( artifacts.DummyERC721Token, provider, diff --git a/packages/monorepo-scripts/src/deps_versions.ts b/packages/monorepo-scripts/src/deps_versions.ts index f090d12e9..1053906b7 100644 --- a/packages/monorepo-scripts/src/deps_versions.ts +++ b/packages/monorepo-scripts/src/deps_versions.ts @@ -19,6 +19,7 @@ interface VersionsByDependency { const PACKAGE_JSON_GLOB = '../*/package.json'; +// tslint:disable:no-unused-variable function getDependencies(path: string): Dependencies { const file = fs.readFileSync(path).toString(); const parsed = JSON.parse(file); @@ -52,3 +53,4 @@ _.map(versionsByDependency, (versions: Versions, depName: string) => { }); } }); +// tslint:disable:no-unused-variable diff --git a/packages/monorepo-scripts/src/find_unused_dependencies.ts b/packages/monorepo-scripts/src/find_unused_dependencies.ts index 71e707224..11e48ab13 100644 --- a/packages/monorepo-scripts/src/find_unused_dependencies.ts +++ b/packages/monorepo-scripts/src/find_unused_dependencies.ts @@ -1,10 +1,8 @@ #!/usr/bin/env node import * as depcheckAsync from 'depcheck'; -import * as fs from 'fs'; import lernaGetPackages = require('lerna-get-packages'); import * as _ from 'lodash'; -import { exec as execAsync } from 'promisify-child-process'; import { constants } from './constants'; import { utils } from './utils/utils'; diff --git a/packages/monorepo-scripts/src/postpublish_utils.ts b/packages/monorepo-scripts/src/postpublish_utils.ts index dbbde894d..e60d9e521 100644 --- a/packages/monorepo-scripts/src/postpublish_utils.ts +++ b/packages/monorepo-scripts/src/postpublish_utils.ts @@ -4,7 +4,6 @@ import * as fs from 'fs'; import * as _ from 'lodash'; import * as path from 'path'; import * as publishRelease from 'publish-release'; -import semverSort = require('semver-sort'); import { constants } from './constants'; import { utils } from './utils/utils'; @@ -53,6 +52,7 @@ export const postpublishUtils = { }, async runAsync(packageJSON: any, tsConfigJSON: any, cwd: string): Promise<void> { const configs = this.generateConfig(packageJSON, tsConfigJSON, cwd); + // tslint:disable-next-line:no-unused-variable const release = await this.publishReleaseNotesAsync( configs.cwd, configs.packageName, @@ -93,8 +93,10 @@ export const postpublishUtils = { const notes = this.getReleaseNotes(packageName, version); const releaseName = this.getReleaseName(packageName, version); const tag = this.getTag(packageName, version); + // tslint:disable-next-line:no-unused-variable const finalAssets = this.adjustAssetPaths(cwd, assets); utils.log('POSTPUBLISH: Releasing ', releaseName, '...'); + // tslint:disable-next-line:no-unused-variable const result = await publishReleaseAsync({ token: constants.githubPersonalAccessToken, owner: '0xProject', diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index 36970f85b..2efbc8bf2 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -2,7 +2,6 @@ import * as promisify from 'es6-promisify'; import * as fs from 'fs'; -import lernaGetPackages = require('lerna-get-packages'); import * as _ from 'lodash'; import * as moment from 'moment'; import opn = require('opn'); diff --git a/packages/monorepo-scripts/src/remove_tags.ts b/packages/monorepo-scripts/src/remove_tags.ts index affdf2751..50e413495 100644 --- a/packages/monorepo-scripts/src/remove_tags.ts +++ b/packages/monorepo-scripts/src/remove_tags.ts @@ -1,6 +1,5 @@ #!/usr/bin/env node -import lernaGetPackages = require('lerna-get-packages'); import * as _ from 'lodash'; import * as path from 'path'; import { exec as execAsync } from 'promisify-child-process'; diff --git a/packages/monorepo-scripts/src/utils/utils.ts b/packages/monorepo-scripts/src/utils/utils.ts index 8f2a0bbaa..0b8ac4c0b 100644 --- a/packages/monorepo-scripts/src/utils/utils.ts +++ b/packages/monorepo-scripts/src/utils/utils.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import lernaGetPackages = require('lerna-get-packages'); import * as _ from 'lodash'; -import { exec as execAsync, spawn } from 'promisify-child-process'; +import { exec as execAsync } from 'promisify-child-process'; import { constants } from '../constants'; import { UpdatedPackage } from '../types'; diff --git a/packages/order-utils/src/assert.ts b/packages/order-utils/src/assert.ts index a1318b9b8..b4335980f 100644 --- a/packages/order-utils/src/assert.ts +++ b/packages/order-utils/src/assert.ts @@ -4,7 +4,6 @@ import { assert as sharedAssert } from '@0xproject/assert'; import { Schema } from '@0xproject/json-schemas'; // tslint:disable-next-line:no-unused-variable import { ECSignature, SignatureType } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; diff --git a/packages/order-utils/src/order_hash.ts b/packages/order-utils/src/order_hash.ts index 2ef746ef8..b9d0b43aa 100644 --- a/packages/order-utils/src/order_hash.ts +++ b/packages/order-utils/src/order_hash.ts @@ -1,9 +1,6 @@ import { schemas, SchemaValidator } from '@0xproject/json-schemas'; import { Order, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import BN = require('bn.js'); -import { SolidityTypes } from 'ethereum-types'; -import * as ethABI from 'ethereumjs-abi'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; diff --git a/packages/order-utils/src/order_state_utils.ts b/packages/order-utils/src/order_state_utils.ts index 61050c9d6..da33ea010 100644 --- a/packages/order-utils/src/order_state_utils.ts +++ b/packages/order-utils/src/order_state_utils.ts @@ -7,7 +7,6 @@ import { SignedOrder, } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; import { AbstractBalanceAndProxyAllowanceFetcher } from './abstract/abstract_balance_and_proxy_allowance_fetcher'; import { AbstractOrderFilledCancelledFetcher } from './abstract/abstract_order_filled_cancelled_fetcher'; diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index c57699af0..c3fa0b6a5 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -159,7 +159,6 @@ export function isValidECSignature(data: string, signature: ECSignature, signerA assert.isHexString('data', data); assert.doesConformToSchema('signature', signature, schemas.ecSignatureSchema); assert.isETHAddressHex('signerAddress', signerAddress); - const normalizedSignerAddress = signerAddress.toLowerCase(); const msgHashBuff = ethUtil.toBuffer(data); try { diff --git a/packages/order-utils/test/assert_test.ts b/packages/order-utils/test/assert_test.ts index 033fd6732..4b22ef27d 100644 --- a/packages/order-utils/test/assert_test.ts +++ b/packages/order-utils/test/assert_test.ts @@ -1,4 +1,3 @@ -import { web3Factory } from '@0xproject/dev-utils'; import * as chai from 'chai'; import 'make-promises-safe'; import 'mocha'; diff --git a/packages/order-utils/test/order_hash_test.ts b/packages/order-utils/test/order_hash_test.ts index d571fc62a..7cf6435c2 100644 --- a/packages/order-utils/test/order_hash_test.ts +++ b/packages/order-utils/test/order_hash_test.ts @@ -1,4 +1,3 @@ -import { web3Factory } from '@0xproject/dev-utils'; import { Order } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; @@ -8,7 +7,6 @@ import 'mocha'; import { constants, orderHashUtils } from '../src'; import { chaiSetup } from './utils/chai_setup'; -import { web3Wrapper } from './utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index c1a3cc7fb..74033104a 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -1,4 +1,3 @@ -import { web3Factory } from '@0xproject/dev-utils'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import { JSONRPCErrorCallback, JSONRPCRequestPayload } from 'ethereum-types'; @@ -7,7 +6,7 @@ import 'make-promises-safe'; import 'mocha'; import * as Sinon from 'sinon'; -import { ecSignOrderHashAsync, generatePseudoRandomSalt, MessagePrefixType, orderHashUtils } from '../src'; +import { ecSignOrderHashAsync, generatePseudoRandomSalt, MessagePrefixType } from '../src'; import { isValidECSignature, isValidSignatureAsync } from '../src/signature_utils'; import { chaiSetup } from './utils/chai_setup'; diff --git a/packages/order-utils/test/utils/web3_wrapper.ts b/packages/order-utils/test/utils/web3_wrapper.ts index 419f76dde..ab801fa7f 100644 --- a/packages/order-utils/test/utils/web3_wrapper.ts +++ b/packages/order-utils/test/utils/web3_wrapper.ts @@ -1,4 +1,4 @@ -import { devConstants, web3Factory } from '@0xproject/dev-utils'; +import { web3Factory } from '@0xproject/dev-utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Provider } from 'ethereum-types'; diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 29936a066..c1f6c9230 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -14,7 +14,7 @@ import { Provider, SignedOrder, } from '@0xproject/types'; -import { AbiDecoder, intervalUtils } from '@0xproject/utils'; +import { intervalUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; diff --git a/packages/order-watcher/src/types.ts b/packages/order-watcher/src/types.ts index 9125af236..b6a1115bd 100644 --- a/packages/order-watcher/src/types.ts +++ b/packages/order-watcher/src/types.ts @@ -1,17 +1,8 @@ -import { BigNumber } from '@0xproject/utils'; import { - BlockParam, BlockParamLiteral, - ContractAbi, - ContractEventArg, - ExchangeContractErrs, - FilterObject, LogEntryEvent, - LogWithDecodedArgs, - Order, OrderState, - SignedOrder, } from '@0xproject/types'; export enum OrderWatcherError { diff --git a/packages/order-watcher/src/utils/assert.ts b/packages/order-watcher/src/utils/assert.ts index 9e02f8bdc..e88f9ac72 100644 --- a/packages/order-watcher/src/utils/assert.ts +++ b/packages/order-watcher/src/utils/assert.ts @@ -4,9 +4,6 @@ import { assert as sharedAssert } from '@0xproject/assert'; import { Schema } from '@0xproject/json-schemas'; // tslint:disable-next-line:no-unused-variable import { ECSignature } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import * as _ from 'lodash'; import { isValidSignature } from '@0xproject/order-utils'; diff --git a/packages/order-watcher/test/event_watcher_test.ts b/packages/order-watcher/test/event_watcher_test.ts index ba77d50dd..8a43ef8f9 100644 --- a/packages/order-watcher/test/event_watcher_test.ts +++ b/packages/order-watcher/test/event_watcher_test.ts @@ -1,4 +1,4 @@ -import { callbackErrorReporter, web3Factory } from '@0xproject/dev-utils'; +import { callbackErrorReporter } from '@0xproject/dev-utils'; import { DoneCallback, LogEntry, LogEntryEvent } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; diff --git a/packages/order-watcher/test/expiration_watcher_test.ts b/packages/order-watcher/test/expiration_watcher_test.ts index ef15bf006..068c267c3 100644 --- a/packages/order-watcher/test/expiration_watcher_test.ts +++ b/packages/order-watcher/test/expiration_watcher_test.ts @@ -1,5 +1,5 @@ import { ContractWrappers } from '@0xproject/contract-wrappers'; -import { BlockchainLifecycle, callbackErrorReporter, devConstants } from '@0xproject/dev-utils'; +import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; import { getOrderHashHex } from '@0xproject/order-utils'; import { DoneCallback, Token } from '@0xproject/types'; @@ -10,7 +10,6 @@ import 'make-promises-safe'; import 'mocha'; import * as Sinon from 'sinon'; -import { artifacts } from '../src/artifacts'; import { ExpirationWatcher } from '../src/order_watcher/expiration_watcher'; import { utils } from '../src/utils/utils'; diff --git a/packages/order-watcher/test/global_hooks.ts b/packages/order-watcher/test/global_hooks.ts index 3d3f0e474..f18eef379 100644 --- a/packages/order-watcher/test/global_hooks.ts +++ b/packages/order-watcher/test/global_hooks.ts @@ -1,9 +1,7 @@ import { devConstants } from '@0xproject/dev-utils'; import { runV1MigrationsAsync } from '@0xproject/migrations'; import 'make-promises-safe'; -import * as path from 'path'; -import { constants } from './utils/constants'; import { provider } from './utils/web3_wrapper'; before('migrate contracts', async function(): Promise<void> { diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts index 0d33e7ea2..d8c918f16 100644 --- a/packages/order-watcher/test/order_watcher_test.ts +++ b/packages/order-watcher/test/order_watcher_test.ts @@ -1,16 +1,8 @@ import { ContractWrappers } from '@0xproject/contract-wrappers'; -import { BlockchainLifecycle, callbackErrorReporter, devConstants } from '@0xproject/dev-utils'; +import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; import { getOrderHashHex } from '@0xproject/order-utils'; -import { - DoneCallback, - ExchangeContractErrs, - OrderState, - OrderStateInvalid, - OrderStateValid, - SignedOrder, - Token, -} from '@0xproject/types'; +import { DoneCallback, ExchangeContractErrs, OrderState, SignedOrder, Token } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; @@ -53,6 +45,7 @@ describe('OrderWatcher', () => { const fillableAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5), decimals); before(async () => { contractWrappers = new ContractWrappers(provider, config); + // tslint:disable-next-line:no-unused-variable const networkId = await web3Wrapper.getNetworkIdAsync(); orderWatcher = new OrderWatcher(provider, constants.TESTRPC_NETWORK_ID); exchangeContractAddress = contractWrappers.exchange.getContractAddress(); @@ -139,7 +132,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState as OrderStateInvalid; + const invalidOrderState = orderState; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.InsufficientMakerAllowance); }); @@ -188,7 +181,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState as OrderStateInvalid; + const invalidOrderState = orderState; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.InsufficientMakerBalance); }); @@ -212,7 +205,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState as OrderStateInvalid; + const invalidOrderState = orderState; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderRemainingFillAmountZero); }); @@ -244,7 +237,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState as OrderStateValid; + const validOrderState = orderState; expect(validOrderState.orderHash).to.be.equal(orderHash); const orderRelevantState = validOrderState.orderRelevantState; const remainingMakerBalance = makerBalance.sub(fillAmountInBaseUnits); @@ -305,7 +298,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState as OrderStateValid; + const validOrderState = orderState; expect(validOrderState.orderHash).to.be.equal(orderHash); const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( @@ -339,7 +332,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { - const validOrderState = orderState as OrderStateValid; + const validOrderState = orderState; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( changedMakerApprovalAmount, @@ -374,7 +367,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState as OrderStateValid; + const validOrderState = orderState; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( remainingAmount, @@ -414,7 +407,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState as OrderStateValid; + const validOrderState = orderState; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( remainingTokenAmount, @@ -447,7 +440,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { - const validOrderState = orderState as OrderStateValid; + const validOrderState = orderState; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( remainingFeeAmount, @@ -482,7 +475,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { - const validOrderState = orderState as OrderStateValid; + const validOrderState = orderState; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( fillableAmount, @@ -511,7 +504,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState as OrderStateInvalid; + const invalidOrderState = orderState; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderRemainingFillAmountZero); }); @@ -535,7 +528,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState as OrderStateInvalid; + const invalidOrderState = orderState; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderFillRoundingError); }); @@ -562,7 +555,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState as OrderStateValid; + const validOrderState = orderState; expect(validOrderState.orderHash).to.be.equal(orderHash); const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.cancelledTakerTokenAmount).to.be.bignumber.equal(cancelAmountInBaseUnits); diff --git a/packages/order-watcher/test/utils/web3_wrapper.ts b/packages/order-watcher/test/utils/web3_wrapper.ts index 71a0dc1c2..f7d11f138 100644 --- a/packages/order-watcher/test/utils/web3_wrapper.ts +++ b/packages/order-watcher/test/utils/web3_wrapper.ts @@ -1,4 +1,4 @@ -import { devConstants, web3Factory } from '@0xproject/dev-utils'; +import { web3Factory } from '@0xproject/dev-utils'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; diff --git a/packages/react-docs-example/ts/docs.tsx b/packages/react-docs-example/ts/docs.tsx index b35e9a629..b70de1257 100644 --- a/packages/react-docs-example/ts/docs.tsx +++ b/packages/react-docs-example/ts/docs.tsx @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import * as React from 'react'; import { @@ -95,9 +94,6 @@ export class Docs extends React.Component<DocsProps, DocsState> { }; } public render(): React.ReactNode { - const menuSubsectionsBySection = _.isUndefined(this.state.docAgnosticFormat) - ? {} - : docsInfo.getMenuSubsectionsBySection(this.state.docAgnosticFormat); return ( <Documentation selectedVersion={this.state.selectedVersion} diff --git a/packages/react-docs/src/components/badge.tsx b/packages/react-docs/src/components/badge.tsx index 0137b153b..d34f8a0fc 100644 --- a/packages/react-docs/src/components/badge.tsx +++ b/packages/react-docs/src/components/badge.tsx @@ -1,5 +1,4 @@ import { Styles } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; const styles: Styles = { diff --git a/packages/react-docs/src/components/comment.tsx b/packages/react-docs/src/components/comment.tsx index 0d63d4d31..c3687c510 100644 --- a/packages/react-docs/src/components/comment.tsx +++ b/packages/react-docs/src/components/comment.tsx @@ -1,5 +1,4 @@ import { MarkdownCodeBlock } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; import * as ReactMarkdown from 'react-markdown'; diff --git a/packages/react-docs/src/components/custom_enum.tsx b/packages/react-docs/src/components/custom_enum.tsx index 797372f35..c4252d9e2 100644 --- a/packages/react-docs/src/components/custom_enum.tsx +++ b/packages/react-docs/src/components/custom_enum.tsx @@ -3,7 +3,6 @@ import * as _ from 'lodash'; import * as React from 'react'; import { CustomType } from '../types'; -import { utils } from '../utils/utils'; const STRING_ENUM_CODE_PREFIX = ' strEnum('; diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 25687db67..2b021f04c 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -3,7 +3,6 @@ import { constants as sharedConstants, EtherscanLinkSuffixes, MarkdownSection, - MenuSubsectionsBySection, NestedSidebarMenu, Networks, SectionHeader, @@ -13,13 +12,11 @@ import { import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import * as React from 'react'; -import { scroller } from 'react-scroll'; import { DocsInfo } from '../docs_info'; import { AddressByContractName, DocAgnosticFormat, - DoxityDocObj, Event, Property, SolidityMethod, @@ -29,7 +26,6 @@ import { TypescriptMethod, } from '../types'; import { constants } from '../utils/constants'; -import { utils } from '../utils/utils'; import { Badge } from './badge'; import { Comment } from './comment'; diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx index c4a6394fa..77e9cc909 100644 --- a/packages/react-docs/src/components/signature.tsx +++ b/packages/react-docs/src/components/signature.tsx @@ -1,6 +1,5 @@ import * as _ from 'lodash'; import * as React from 'react'; -import * as ReactDOM from 'react-dom'; import { DocsInfo } from '../docs_info'; import { Parameter, Type as TypeDef, TypeDefinitionByName, TypeParameter } from '../types'; diff --git a/packages/react-docs/src/components/source_link.tsx b/packages/react-docs/src/components/source_link.tsx index 58a9ba6a7..c60435ea6 100644 --- a/packages/react-docs/src/components/source_link.tsx +++ b/packages/react-docs/src/components/source_link.tsx @@ -1,5 +1,4 @@ import { colors } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; import { Source } from '../types'; diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx index 2b7b49672..caf0796ee 100644 --- a/packages/react-docs/src/components/type.tsx +++ b/packages/react-docs/src/components/type.tsx @@ -6,22 +6,11 @@ import * as ReactTooltip from 'react-tooltip'; import { DocsInfo } from '../docs_info'; import { Type as TypeDef, TypeDefinitionByName, TypeDocTypes } from '../types'; -import { constants } from '../utils/constants'; import { utils } from '../utils/utils'; import { Signature } from './signature'; import { TypeDefinition } from './type_definition'; -const typeToSection: { [typeName: string]: string } = { - ExchangeWrapper: 'exchange', - TokenWrapper: 'token', - TokenRegistryWrapper: 'tokenRegistry', - EtherTokenWrapper: 'etherToken', - ProxyWrapper: 'proxy', - TokenTransferProxyWrapper: 'proxy', - OrderStateWatcher: 'orderWatcher', -}; - export interface TypeProps { type: TypeDef; docsInfo: DocsInfo; diff --git a/packages/react-docs/src/components/type_definition.tsx b/packages/react-docs/src/components/type_definition.tsx index a8e601ac2..fdaad556b 100644 --- a/packages/react-docs/src/components/type_definition.tsx +++ b/packages/react-docs/src/components/type_definition.tsx @@ -3,7 +3,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import { DocsInfo } from '../docs_info'; -import { CustomType, CustomTypeChild, EnumValue, KindString, TypeDocTypes } from '../types'; +import { CustomType, CustomTypeChild, KindString, TypeDocTypes } from '../types'; import { constants } from '../utils/constants'; import { utils } from '../utils/utils'; diff --git a/packages/react-shared/src/components/markdown_code_block.tsx b/packages/react-shared/src/components/markdown_code_block.tsx index 49b2ff526..bca8a7a90 100644 --- a/packages/react-shared/src/components/markdown_code_block.tsx +++ b/packages/react-shared/src/components/markdown_code_block.tsx @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import * as React from 'react'; import * as HighLight from 'react-highlight'; diff --git a/packages/react-shared/src/components/markdown_section.tsx b/packages/react-shared/src/components/markdown_section.tsx index b0761cd21..3b65b3075 100644 --- a/packages/react-shared/src/components/markdown_section.tsx +++ b/packages/react-shared/src/components/markdown_section.tsx @@ -1,5 +1,4 @@ import * as _ from 'lodash'; -import RaisedButton from 'material-ui/RaisedButton'; import * as React from 'react'; import * as ReactMarkdown from 'react-markdown'; import { Element as ScrollElement } from 'react-scroll'; diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx index 804398d71..9b08e3c53 100644 --- a/packages/react-shared/src/components/nested_sidebar_menu.tsx +++ b/packages/react-shared/src/components/nested_sidebar_menu.tsx @@ -47,6 +47,7 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N const navigation = _.map(this.props.topLevelMenu, (menuItems: string[], sectionName: string) => { const finalSectionName = utils.convertDashesToSpaces(sectionName); if (this.props.shouldDisplaySectionHeaders) { + // tslint:disable-next-line:no-unused-variable const id = utils.getIdFromName(sectionName); return ( <div key={`section-${sectionName}`} className="py1" style={{ color: colors.grey800 }}> diff --git a/packages/react-shared/src/components/section_header.tsx b/packages/react-shared/src/components/section_header.tsx index 9bbec7747..137b63765 100644 --- a/packages/react-shared/src/components/section_header.tsx +++ b/packages/react-shared/src/components/section_header.tsx @@ -33,7 +33,7 @@ export class SectionHeader extends React.Component<SectionHeaderProps, SectionHe }; } public render(): React.ReactNode { - const { sectionName, headerSize } = this.props as PropsWithDefaults; + const { headerSize } = this.props as PropsWithDefaults; const finalSectionName = utils.convertDashesToSpaces(this.props.sectionName); const id = utils.getIdFromName(finalSectionName); diff --git a/packages/react-shared/src/components/version_drop_down.tsx b/packages/react-shared/src/components/version_drop_down.tsx index 926dd6a7a..115fe3c6a 100644 --- a/packages/react-shared/src/components/version_drop_down.tsx +++ b/packages/react-shared/src/components/version_drop_down.tsx @@ -3,8 +3,6 @@ import DropDownMenu from 'material-ui/DropDownMenu'; import MenuItem from 'material-ui/MenuItem'; import * as React from 'react'; -import { utils } from '../utils/utils'; - export interface VersionDropDownProps { selectedVersion: string; versions: string[]; diff --git a/packages/sol-compiler/src/cli.ts b/packages/sol-compiler/src/cli.ts index b97cf4cab..8901c0a31 100644 --- a/packages/sol-compiler/src/cli.ts +++ b/packages/sol-compiler/src/cli.ts @@ -1,16 +1,11 @@ #!/usr/bin/env node // We need the above pragma since this script will be run as a command-line tool. -import { BigNumber, logUtils } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import { logUtils } from '@0xproject/utils'; import * as _ from 'lodash'; -import * as path from 'path'; -import * as Web3 from 'web3'; import * as yargs from 'yargs'; import { Compiler } from './compiler'; -import { constants } from './utils/constants'; -import { CompilerOptions } from './utils/types'; const DEFAULT_CONTRACTS_LIST = '*'; const SEPARATOR = ','; diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index d2dda75ea..bb701a8ce 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -1,8 +1,5 @@ import { assert } from '@0xproject/assert'; import { - ContractSource, - ContractSources, - EnumerableResolver, FallthroughResolver, FSResolver, NameResolver, @@ -11,9 +8,8 @@ import { Resolver, URLResolver, } from '@0xproject/sol-resolver'; -import { logUtils, promisify } from '@0xproject/utils'; +import { logUtils } from '@0xproject/utils'; import chalk from 'chalk'; -import { ContractAbi } from 'ethereum-types'; import * as ethUtil from 'ethereumjs-util'; import * as fs from 'fs'; import 'isomorphic-fetch'; @@ -34,15 +30,7 @@ import { } from './utils/compiler'; import { constants } from './utils/constants'; import { fsWrapper } from './utils/fs_wrapper'; -import { - CompilerOptions, - ContractArtifact, - ContractNetworkData, - ContractNetworks, - ContractSourceData, - ContractSpecificSourceData, - ContractVersionData, -} from './utils/types'; +import { CompilerOptions, ContractArtifact, ContractVersionData } from './utils/types'; import { utils } from './utils/utils'; type TYPE_ALL_FILES_IDENTIFIER = '*'; @@ -172,7 +160,6 @@ export class Compiler { const solcInstance = solc.setupMethods(requireFromString(solcjs, compilerBinFilename)); logUtils.log(`Compiling ${contractName} with Solidity v${solcVersion}...`); - const source = contractSource.source; const standardInput: solc.StandardInput = { language: 'Solidity', sources: { diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts index 715ecd6f0..08e2d999a 100644 --- a/packages/sol-compiler/src/utils/compiler.ts +++ b/packages/sol-compiler/src/utils/compiler.ts @@ -1,10 +1,8 @@ -import { ContractSource, ContractSources } from '@0xproject/sol-resolver'; +import { ContractSource } from '@0xproject/sol-resolver'; import { logUtils } from '@0xproject/utils'; import * as _ from 'lodash'; import * as path from 'path'; -import * as solc from 'solc'; -import { constants } from './constants'; import { fsWrapper } from './fs_wrapper'; import { ContractArtifact } from './types'; diff --git a/packages/sol-compiler/src/utils/types.ts b/packages/sol-compiler/src/utils/types.ts index 759a7a555..4321a2235 100644 --- a/packages/sol-compiler/src/utils/types.ts +++ b/packages/sol-compiler/src/utils/types.ts @@ -1,7 +1,4 @@ -import { ContractAbi, Provider, TxData } from 'ethereum-types'; import * as solc from 'solc'; -import * as Web3 from 'web3'; -import * as yargs from 'yargs'; export enum AbiType { Function = 'function', diff --git a/packages/sol-compiler/test/compiler_test.ts b/packages/sol-compiler/test/compiler_test.ts index 991965caa..54a117c5a 100644 --- a/packages/sol-compiler/test/compiler_test.ts +++ b/packages/sol-compiler/test/compiler_test.ts @@ -5,7 +5,7 @@ import 'mocha'; import { Compiler } from '../src/compiler'; import { fsWrapper } from '../src/utils/fs_wrapper'; -import { CompilerOptions, ContractArtifact, ContractNetworkData } from '../src/utils/types'; +import { CompilerOptions, ContractArtifact } from '../src/utils/types'; import { exchange_binary } from './fixtures/exchange_bin'; import { constants } from './util/constants'; diff --git a/packages/sol-compiler/test/util/provider.ts b/packages/sol-compiler/test/util/provider.ts index 7215ffae7..cc372b2eb 100644 --- a/packages/sol-compiler/test/util/provider.ts +++ b/packages/sol-compiler/test/util/provider.ts @@ -1,6 +1,5 @@ import { web3Factory } from '@0xproject/dev-utils'; import { Provider } from 'ethereum-types'; -import * as Web3 from 'web3'; const providerConfigs = { shouldUseInProcessGanache: true }; const provider: Provider = web3Factory.getRpcProvider(providerConfigs); diff --git a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts index d08828bf6..6e385203b 100644 --- a/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter.ts @@ -32,7 +32,6 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter { const artifact = JSON.parse(fs.readFileSync(artifactFileName).toString()); let sources = _.keys(artifact.sources); sources = _.map(sources, relativeFilePath => path.resolve(this._sourcesPath, relativeFilePath)); - const contractName = artifact.contractName; const sourceCodes = _.map(sources, (source: string) => fs.readFileSync(source).toString()); const contractData = { sourceCodes, diff --git a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts index c7f21b6eb..53449e5e1 100644 --- a/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts +++ b/packages/sol-cov/src/artifact_adapters/truffle_artifact_adapter.ts @@ -1,8 +1,4 @@ import { Compiler, CompilerOptions } from '@0xproject/sol-compiler'; -import * as fs from 'fs'; -import * as glob from 'glob'; -import * as _ from 'lodash'; -import * as path from 'path'; import * as rimraf from 'rimraf'; import { ContractData } from '../types'; diff --git a/packages/sol-cov/src/collect_coverage_entries.ts b/packages/sol-cov/src/collect_coverage_entries.ts index 97218616c..b145f044e 100644 --- a/packages/sol-cov/src/collect_coverage_entries.ts +++ b/packages/sol-cov/src/collect_coverage_entries.ts @@ -1,7 +1,5 @@ import * as ethUtil from 'ethereumjs-util'; -import * as fs from 'fs'; import * as _ from 'lodash'; -import * as path from 'path'; import * as parser from 'solidity-parser-antlr'; import { ASTVisitor, CoverageEntriesDescription } from './ast_visitor'; diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts index 31b0e6fbc..064338a32 100644 --- a/packages/sol-cov/src/coverage_manager.ts +++ b/packages/sol-cov/src/coverage_manager.ts @@ -1,11 +1,10 @@ import { promisify } from '@0xproject/utils'; -import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; +import { stripHexPrefix } from 'ethereumjs-util'; import * as fs from 'fs'; import { Collector } from 'istanbul'; import * as _ from 'lodash'; -import { getLogger, levels, Logger, LogLevel } from 'loglevel'; +import { getLogger, levels, Logger } from 'loglevel'; import * as mkdirp from 'mkdirp'; -import * as path from 'path'; import { AbstractArtifactAdapter } from './artifact_adapters/abstract_artifact_adapter'; import { collectCoverageEntries } from './collect_coverage_entries'; @@ -14,18 +13,14 @@ import { parseSourceMap } from './source_maps'; import { BranchCoverage, BranchDescription, - BranchMap, ContractData, Coverage, - FnMap, FunctionCoverage, FunctionDescription, - LineColumn, SingleFileSourceRange, SourceRange, StatementCoverage, StatementDescription, - StatementMap, TraceInfo, TraceInfoExistingContract, TraceInfoNewContract, @@ -38,6 +33,7 @@ export class CoverageManager { private _artifactAdapter: AbstractArtifactAdapter; private _logger: Logger; private _traceInfos: TraceInfo[] = []; + // tslint:disable-next-line:no-unused-variable private _getContractCodeAsync: (address: string) => Promise<string>; private static _getSingleFileCoverageForTrace( contractData: ContractData, diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index ca7f4aed2..13b76f537 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -1,6 +1,5 @@ import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0xproject/subproviders'; import { BlockParam, CallData, JSONRPCRequestPayload, TransactionTrace, TxData } from 'ethereum-types'; -import * as fs from 'fs'; import * as _ from 'lodash'; import { Lock } from 'semaphore-async-await'; diff --git a/packages/sol-cov/src/source_maps.ts b/packages/sol-cov/src/source_maps.ts index 694171442..f9503e16c 100644 --- a/packages/sol-cov/src/source_maps.ts +++ b/packages/sol-cov/src/source_maps.ts @@ -38,10 +38,10 @@ export function parseSourceMap( const pcToInstructionIndex: { [programCounter: number]: number } = getPcToInstructionIndexMapping(bytecode); const locationByOffsetByFileIndex = _.map(sourceCodes, getLocationByOffset); const entries = srcMap.split(';'); - const parsedEntries: SourceLocation[] = []; let lastParsedEntry: SourceLocation = {} as any; const instructionIndexToSourceRange: { [instructionIndex: number]: SourceRange } = {}; _.each(entries, (entry: string, i: number) => { + // tslint:disable-next-line:no-unused-variable const [instructionIndexStrIfExists, lengthStrIfExists, fileIndexStrIfExists, jumpTypeStrIfExists] = entry.split( ':', ); diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index 1c21c8e5c..c725de3d0 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -1,7 +1,6 @@ import { addressUtils, BigNumber, logUtils } from '@0xproject/utils'; -import { OpCode, StructLog, TransactionTrace } from 'ethereum-types'; -import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; -import * as fs from 'fs'; +import { OpCode, StructLog } from 'ethereum-types'; +import { addHexPrefix } from 'ethereumjs-util'; import * as _ from 'lodash'; export interface TraceByContractAddress { diff --git a/packages/sol-cov/test/instructions_test.ts b/packages/sol-cov/test/instructions_test.ts index 8012674f5..02f30a5ca 100644 --- a/packages/sol-cov/test/instructions_test.ts +++ b/packages/sol-cov/test/instructions_test.ts @@ -1,8 +1,6 @@ import * as chai from 'chai'; -import * as fs from 'fs'; import 'make-promises-safe'; import 'mocha'; -import * as path from 'path'; import { constants } from '../src/constants'; import { getPcToInstructionIndexMapping } from '../src/instructions'; diff --git a/packages/sol-cov/test/trace_test.ts b/packages/sol-cov/test/trace_test.ts index 07e270b71..7a034362c 100644 --- a/packages/sol-cov/test/trace_test.ts +++ b/packages/sol-cov/test/trace_test.ts @@ -1,9 +1,7 @@ import * as chai from 'chai'; import { OpCode, StructLog } from 'ethereum-types'; -import * as fs from 'fs'; import * as _ from 'lodash'; import 'mocha'; -import * as path from 'path'; import { getTracesByContractAddress } from '../src/trace'; diff --git a/packages/sol-resolver/src/resolvers/name_resolver.ts b/packages/sol-resolver/src/resolvers/name_resolver.ts index e489c70a7..bcd98615f 100644 --- a/packages/sol-resolver/src/resolvers/name_resolver.ts +++ b/packages/sol-resolver/src/resolvers/name_resolver.ts @@ -1,5 +1,4 @@ import * as fs from 'fs'; -import * as _ from 'lodash'; import * as path from 'path'; import { ContractSource } from '../types'; @@ -35,7 +34,6 @@ export class NameResolver extends EnumerableResolver { public getAll(): ContractSource[] { const contractSources: ContractSource[] = []; const onFile = (filePath: string) => { - const contractName = path.basename(filePath, SOLIDITY_FILE_EXTENSION); const absoluteContractPath = path.join(this._contractsDir, filePath); const source = fs.readFileSync(absoluteContractPath).toString(); const contractSource = { diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts index 3b72ad44e..faa904441 100644 --- a/packages/sra-report/src/index.ts +++ b/packages/sra-report/src/index.ts @@ -1,10 +1,8 @@ #!/usr/bin/env node import { assert } from '@0xproject/assert'; -import { Schema, schemas } from '@0xproject/json-schemas'; -import { logUtils, promisify } from '@0xproject/utils'; +import { logUtils } from '@0xproject/utils'; import chalk from 'chalk'; import * as _ from 'lodash'; -import * as newman from 'newman'; import * as yargs from 'yargs'; import * as sraReportCollectionJSON from '../../postman_collections/sra_report.postman_collection.json'; diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts index f8fe02d72..3dcb97829 100644 --- a/packages/sra-report/src/postman_environment_factory.ts +++ b/packages/sra-report/src/postman_environment_factory.ts @@ -1,7 +1,6 @@ import { HttpClient } from '@0xproject/connect'; import { Schema, schemas as schemasByName } from '@0xproject/json-schemas'; import { getOrderHashHex } from '@0xproject/order-utils'; -import { SignedOrder } from '@0xproject/types'; import { logUtils } from '@0xproject/utils'; import chalk from 'chalk'; import * as _ from 'lodash'; diff --git a/packages/sra-report/test/test_runner.ts b/packages/sra-report/test/test_runner.ts index fe238e98a..210eb7932 100644 --- a/packages/sra-report/test/test_runner.ts +++ b/packages/sra-report/test/test_runner.ts @@ -112,7 +112,6 @@ export const testRunner = { nockInterceptor.reply(SUCCESS_STATUS, correctJson); const summary = await utils.newmanRunAsync(newmanRunOptions); const error = findAssertionErrorIfExists(summary, postmanCollectionRequestName, SCHEMA_ASSERTION_NAME); - const errorMessage = _.get(error, 'message'); expect(error).to.be.undefined(); }); }); diff --git a/packages/subproviders/src/subproviders/base_wallet_subprovider.ts b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts index c4b344e3b..4342e47e9 100644 --- a/packages/subproviders/src/subproviders/base_wallet_subprovider.ts +++ b/packages/subproviders/src/subproviders/base_wallet_subprovider.ts @@ -3,7 +3,7 @@ import { addressUtils } from '@0xproject/utils'; import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types'; import * as _ from 'lodash'; -import { Callback, ErrorCallback, PartialTxParams, ResponseWithTxParams, WalletSubproviderErrors } from '../types'; +import { Callback, ErrorCallback, PartialTxParams, WalletSubproviderErrors } from '../types'; import { Subprovider } from './subprovider'; diff --git a/packages/subproviders/src/subproviders/injected_web3.ts b/packages/subproviders/src/subproviders/injected_web3.ts index 165c66d62..2691dec53 100644 --- a/packages/subproviders/src/subproviders/injected_web3.ts +++ b/packages/subproviders/src/subproviders/injected_web3.ts @@ -1,5 +1,4 @@ import { JSONRPCRequestPayload, Provider } from 'ethereum-types'; -import * as _ from 'lodash'; import * as Web3 from 'web3'; import { Callback, ErrorCallback } from '../types'; diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts index 467299db0..8345be33c 100644 --- a/packages/subproviders/src/subproviders/ledger.ts +++ b/packages/subproviders/src/subproviders/ledger.ts @@ -7,14 +7,12 @@ import * as _ from 'lodash'; import { Lock } from 'semaphore-async-await'; import { - Callback, DerivedHDKeyInfo, LedgerEthereumClient, LedgerEthereumClientFactoryAsync, LedgerSubproviderConfigs, LedgerSubproviderErrors, PartialTxParams, - ResponseWithTxParams, WalletSubproviderErrors, } from '../types'; import { walletUtils } from '../utils/wallet_utils'; @@ -33,6 +31,7 @@ const DEFAULT_ADDRESS_SEARCH_LIMIT = 1000; * re-routes them to a Ledger device plugged into the users computer. */ export class LedgerSubprovider extends BaseWalletSubprovider { + // tslint:disable-next-line:no-unused-variable private _nonceLock = new Lock(); private _connectionLock = new Lock(); private _networkId: number; diff --git a/packages/subproviders/src/subproviders/mnemonic_wallet.ts b/packages/subproviders/src/subproviders/mnemonic_wallet.ts index f29864a74..596300425 100644 --- a/packages/subproviders/src/subproviders/mnemonic_wallet.ts +++ b/packages/subproviders/src/subproviders/mnemonic_wallet.ts @@ -1,7 +1,6 @@ import { assert } from '@0xproject/assert'; import { addressUtils } from '@0xproject/utils'; import * as bip39 from 'bip39'; -import ethUtil = require('ethereumjs-util'); import HDNode = require('hdkey'); import * as _ from 'lodash'; diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts index f9491707e..329bf7d9c 100644 --- a/packages/subproviders/src/subproviders/subprovider.ts +++ b/packages/subproviders/src/subproviders/subprovider.ts @@ -1,6 +1,5 @@ import { promisify } from '@0xproject/utils'; import { JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types'; -import * as Web3 from 'web3'; import { Callback, ErrorCallback, JSONRPCRequestPayloadWithMethod } from '../types'; /** diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts index 7a8413305..fe58bffa5 100644 --- a/packages/subproviders/src/types.ts +++ b/packages/subproviders/src/types.ts @@ -1,7 +1,6 @@ import { ECSignature } from '@0xproject/types'; import { JSONRPCRequestPayload } from 'ethereum-types'; import HDNode = require('hdkey'); -import * as _ from 'lodash'; export interface LedgerCommunicationClient { close: () => Promise<void>; diff --git a/packages/subproviders/src/utils/wallet_utils.ts b/packages/subproviders/src/utils/wallet_utils.ts index c36fdb9fc..3748077ef 100644 --- a/packages/subproviders/src/utils/wallet_utils.ts +++ b/packages/subproviders/src/utils/wallet_utils.ts @@ -1,8 +1,7 @@ import ethUtil = require('ethereumjs-util'); import HDNode = require('hdkey'); -import * as _ from 'lodash'; -import { DerivedHDKeyInfo, WalletSubproviderErrors } from '../types'; +import { DerivedHDKeyInfo } from '../types'; const DEFAULT_ADDRESS_SEARCH_LIMIT = 1000; diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts index 315dfa894..92d6614d3 100644 --- a/packages/subproviders/test/integration/ledger_subprovider_test.ts +++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts @@ -7,9 +7,7 @@ import TransportNodeHid from '@ledgerhq/hw-transport-node-hid'; import * as chai from 'chai'; import { JSONRPCResponsePayload } from 'ethereum-types'; import * as ethUtils from 'ethereumjs-util'; -import * as _ from 'lodash'; import 'make-promises-safe'; -import Web3 = require('web3'); import Web3ProviderEngine = require('web3-provider-engine'); import RpcSubprovider = require('web3-provider-engine/subproviders/rpc'); diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts index 17e72a694..d3efb6abc 100644 --- a/packages/subproviders/test/unit/ledger_subprovider_test.ts +++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts @@ -3,7 +3,6 @@ import { JSONRPCResponsePayload } from 'ethereum-types'; import * as ethUtils from 'ethereumjs-util'; import * as _ from 'lodash'; import 'make-promises-safe'; -import Web3 = require('web3'); import Web3ProviderEngine = require('web3-provider-engine'); import { LedgerSubprovider } from '../../src'; diff --git a/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts b/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts index fba221af0..5fc615ced 100644 --- a/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts +++ b/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts @@ -1,15 +1,12 @@ import * as chai from 'chai'; import { JSONRPCResponsePayload } from 'ethereum-types'; import * as ethUtils from 'ethereumjs-util'; -import * as _ from 'lodash'; import 'make-promises-safe'; import Web3ProviderEngine = require('web3-provider-engine'); import { GanacheSubprovider, MnemonicWalletSubprovider } from '../../src/'; import { DoneCallback, - LedgerCommunicationClient, - LedgerSubproviderErrors, WalletSubproviderErrors, } from '../../src/types'; import { chaiSetup } from '../chai_setup'; diff --git a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts index f4aa926d7..2475dde7a 100644 --- a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts +++ b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts @@ -1,8 +1,5 @@ import * as chai from 'chai'; -import * as fs from 'fs'; -import * as _ from 'lodash'; import 'make-promises-safe'; -import * as path from 'path'; import Web3ProviderEngine = require('web3-provider-engine'); import FixtureSubprovider = require('web3-provider-engine/subproviders/fixture'); diff --git a/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts b/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts index ac88d8cac..cf7b461fb 100644 --- a/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts +++ b/packages/subproviders/test/unit/private_key_wallet_subprovider_test.ts @@ -1,15 +1,12 @@ import * as chai from 'chai'; import { JSONRPCResponsePayload } from 'ethereum-types'; import * as ethUtils from 'ethereumjs-util'; -import * as _ from 'lodash'; import 'make-promises-safe'; import Web3ProviderEngine = require('web3-provider-engine'); import { GanacheSubprovider, PrivateKeyWalletSubprovider } from '../../src/'; import { DoneCallback, - LedgerCommunicationClient, - LedgerSubproviderErrors, WalletSubproviderErrors, } from '../../src/types'; import { chaiSetup } from '../chai_setup'; diff --git a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts index fcfec1367..b8b72259d 100644 --- a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts +++ b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts @@ -1,9 +1,7 @@ import { DoneCallback } from '@0xproject/types'; import * as chai from 'chai'; import { JSONRPCResponsePayload } from 'ethereum-types'; -import * as _ from 'lodash'; import 'make-promises-safe'; -import Web3 = require('web3'); import Web3ProviderEngine = require('web3-provider-engine'); import RpcSubprovider = require('web3-provider-engine/subproviders/rpc'); diff --git a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts index 39ba4bc14..41b6c90cd 100644 --- a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts +++ b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts @@ -4,7 +4,6 @@ import * as _ from 'lodash'; import * as Web3 from 'web3'; import { configs } from './configs'; -import { errorReporter } from './error_reporter'; const DISPENSE_AMOUNT_ETHER = 0.1; const DISPENSE_AMOUNT_TOKEN = 0.1; diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index 3a105742e..ae7492400 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -1,4 +1,4 @@ -import { Order, SignedOrder, ZeroEx } from '0x.js'; +import { Order, ZeroEx } from '0x.js'; import { BigNumber, logUtils } from '@0xproject/utils'; import { Provider } from 'ethereum-types'; import * as express from 'express'; @@ -171,6 +171,7 @@ export class Handler { ...order, ecSignature: signature, }; + // tslint:disable-next-line:no-unused-variable const signedOrderHash = ZeroEx.getOrderHashHex(signedOrder); const payload = JSON.stringify(signedOrder); logUtils.log(`Dispensed signed order: ${payload}`); diff --git a/packages/testnet-faucets/src/ts/parameter_transformer.ts b/packages/testnet-faucets/src/ts/parameter_transformer.ts index b9929a0d9..7320b1d1c 100644 --- a/packages/testnet-faucets/src/ts/parameter_transformer.ts +++ b/packages/testnet-faucets/src/ts/parameter_transformer.ts @@ -2,7 +2,6 @@ import { addressUtils } from '@0xproject/utils'; import { NextFunction, Request, Response } from 'express'; import * as _ from 'lodash'; -import { configs } from './configs'; import { constants } from './constants'; import { rpcUrls } from './rpc_urls'; diff --git a/packages/tslint-config/rules/booleanNamingRule.ts b/packages/tslint-config/rules/booleanNamingRule.ts index a8e1dc390..6590f689b 100644 --- a/packages/tslint-config/rules/booleanNamingRule.ts +++ b/packages/tslint-config/rules/booleanNamingRule.ts @@ -3,7 +3,7 @@ import * as Lint from 'tslint'; import * as ts from 'typescript'; const VALID_BOOLEAN_PREFIXES = ['is', 'does', 'should', 'was', 'has', 'can', 'did', 'would', 'are']; - +// tslint:disable:no-unnecessary-type-assertion export class Rule extends Lint.Rules.TypedRule { public static FAILURE_STRING = `Boolean variable names should begin with: ${VALID_BOOLEAN_PREFIXES.join(', ')}`; @@ -66,3 +66,4 @@ function handleBooleanNaming( } } } +// tslint:enable:no-unnecessary-type-assertion diff --git a/packages/tslint-config/rules/customNoMagicNumbersRule.ts b/packages/tslint-config/rules/customNoMagicNumbersRule.ts index e358221eb..0a565b2e6 100644 --- a/packages/tslint-config/rules/customNoMagicNumbersRule.ts +++ b/packages/tslint-config/rules/customNoMagicNumbersRule.ts @@ -2,6 +2,7 @@ import * as Lint from 'tslint'; import { isPrefixUnaryExpression } from 'tsutils'; import * as ts from 'typescript'; +// tslint:disable:no-unnecessary-type-assertion /** * A modified version of the no-magic-numbers rule that allows for magic numbers * when instantiating a BigNumber instance. @@ -74,3 +75,4 @@ class CustomNoMagicNumbersWalker extends Lint.AbstractWalker<Set<string>> { } // tslint:enable:no-non-null-assertion } +// tslint:enable:no-unnecessary-type-assertion diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json index 77a1f41cc..a7b630885 100644 --- a/packages/tslint-config/tslint.json +++ b/packages/tslint-config/tslint.json @@ -45,6 +45,7 @@ "no-parameter-reassignment": true, "no-redundant-jsdoc": true, "no-return-await": true, + "no-unused-variable": true, "no-string-throw": true, "no-submodule-imports": false, "no-unnecessary-type-assertion": true, diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 5a4d23a9e..7cecae419 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,5 +1,5 @@ import { BigNumber } from 'bignumber.js'; -import { ContractAbi, DecodedLogArgs, LogEntry, LogWithDecodedArgs, TransactionReceipt } from 'ethereum-types'; +import { ContractAbi } from 'ethereum-types'; // HACK: Rather then extending from OrderWithoutExchangeAddress // we don't, because our docs don't expand inherited types, and it's unnecessarily diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index ed3297ee1..931cb94b2 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -29,12 +29,9 @@ export class AbiDecoder { return log; } const ethersInterface = new ethers.Interface([event]); - const logData = log.data; const decodedParams: DecodedLogArgs = {}; let topicsIndex = 1; - const nonIndexedInputs = _.filter(event.inputs, input => !input.indexed); - const dataTypes = _.map(nonIndexedInputs, input => input.type); const decodedData = ethersInterface.events[event.name].parse(log.data); let didFailToDecode = false; diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts index b5822425c..413c2f481 100644 --- a/packages/utils/src/abi_utils.ts +++ b/packages/utils/src/abi_utils.ts @@ -1,4 +1,4 @@ -import { AbiDefinition, AbiType, ConstructorAbi, ContractAbi, DataItem, MethodAbi } from 'ethereum-types'; +import { AbiDefinition, AbiType, ContractAbi, DataItem, MethodAbi } from 'ethereum-types'; import * as _ from 'lodash'; export const abiUtils = { diff --git a/packages/utils/src/interval_utils.ts b/packages/utils/src/interval_utils.ts index 6784d5b35..6e296ceeb 100644 --- a/packages/utils/src/interval_utils.ts +++ b/packages/utils/src/interval_utils.ts @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; export const intervalUtils = { setAsyncExcludingInterval( diff --git a/packages/website/ts/blockchain_watcher.ts b/packages/website/ts/blockchain_watcher.ts index 0d376bc74..3890a9e57 100644 --- a/packages/website/ts/blockchain_watcher.ts +++ b/packages/website/ts/blockchain_watcher.ts @@ -1,8 +1,7 @@ -import { BigNumber, intervalUtils, logUtils, promisify } from '@0xproject/utils'; +import { BigNumber, intervalUtils, logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import { Dispatcher } from 'ts/redux/dispatcher'; -import { utils } from 'ts/utils/utils'; export class BlockchainWatcher { private _dispatcher: Dispatcher; diff --git a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx index 7156e700b..b968a3147 100644 --- a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx +++ b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx @@ -1,5 +1,4 @@ import { colors, Networks } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import * as React from 'react'; diff --git a/packages/website/ts/components/dialogs/track_token_confirmation_dialog.tsx b/packages/website/ts/components/dialogs/track_token_confirmation_dialog.tsx index ac0b27cdc..f6594b9d5 100644 --- a/packages/website/ts/components/dialogs/track_token_confirmation_dialog.tsx +++ b/packages/website/ts/components/dialogs/track_token_confirmation_dialog.tsx @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import * as React from 'react'; diff --git a/packages/website/ts/components/eth_wrappers.tsx b/packages/website/ts/components/eth_wrappers.tsx index 1db5ff77f..2fba6849d 100644 --- a/packages/website/ts/components/eth_wrappers.tsx +++ b/packages/website/ts/components/eth_wrappers.tsx @@ -20,7 +20,6 @@ import { } from 'ts/types'; import { configs } from 'ts/utils/configs'; import { constants } from 'ts/utils/constants'; -import { utils } from 'ts/utils/utils'; const DATE_FORMAT = 'D/M/YY'; const ICON_DIMENSION = 40; diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx index d61dfa87d..1e76b37fb 100644 --- a/packages/website/ts/components/inputs/allowance_toggle.tsx +++ b/packages/website/ts/components/inputs/allowance_toggle.tsx @@ -1,6 +1,5 @@ import { constants as sharedConstants, Styles } from '@0xproject/react-shared'; import { BigNumber, logUtils } from '@0xproject/utils'; -import * as _ from 'lodash'; import Toggle from 'material-ui/Toggle'; import * as React from 'react'; import { Blockchain } from 'ts/blockchain'; @@ -8,7 +7,6 @@ import { Dispatcher } from 'ts/redux/dispatcher'; import { BalanceErrs, Token, TokenState } from 'ts/types'; import { analytics } from 'ts/utils/analytics'; import { colors } from 'ts/utils/colors'; -import { constants } from 'ts/utils/constants'; import { errorReporter } from 'ts/utils/error_reporter'; import { utils } from 'ts/utils/utils'; diff --git a/packages/website/ts/components/inputs/identicon_address_input.tsx b/packages/website/ts/components/inputs/identicon_address_input.tsx index a4dc01ba8..6ba7584a7 100644 --- a/packages/website/ts/components/inputs/identicon_address_input.tsx +++ b/packages/website/ts/components/inputs/identicon_address_input.tsx @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import * as React from 'react'; import { AddressInput } from 'ts/components/inputs/address_input'; import { Identicon } from 'ts/components/ui/identicon'; diff --git a/packages/website/ts/components/inputs/token_input.tsx b/packages/website/ts/components/inputs/token_input.tsx index c2c4dd63b..0bd36781e 100644 --- a/packages/website/ts/components/inputs/token_input.tsx +++ b/packages/website/ts/components/inputs/token_input.tsx @@ -1,5 +1,4 @@ import { colors } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import Paper from 'material-ui/Paper'; import * as React from 'react'; import { Blockchain } from 'ts/blockchain'; diff --git a/packages/website/ts/components/legacy_portal/legacy_portal.tsx b/packages/website/ts/components/legacy_portal/legacy_portal.tsx index e5d152e3e..baca1b334 100644 --- a/packages/website/ts/components/legacy_portal/legacy_portal.tsx +++ b/packages/website/ts/components/legacy_portal/legacy_portal.tsx @@ -1,5 +1,5 @@ import { colors } from '@0xproject/react-shared'; -import { BigNumber, logUtils } from '@0xproject/utils'; +import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import Paper from 'material-ui/Paper'; @@ -15,20 +15,15 @@ import { EthWrappers } from 'ts/components/eth_wrappers'; import { FillOrder } from 'ts/components/fill_order'; import { Footer } from 'ts/components/footer'; import { LegacyPortalMenu } from 'ts/components/legacy_portal/legacy_portal_menu'; -import { RelayerIndex } from 'ts/components/relayer_index/relayer_index'; import { TokenBalances } from 'ts/components/token_balances'; import { TopBar } from 'ts/components/top_bar/top_bar'; import { TradeHistory } from 'ts/components/trade_history/trade_history'; import { FlashMessage } from 'ts/components/ui/flash_message'; -import { Wallet } from 'ts/components/wallet/wallet'; import { GenerateOrderForm } from 'ts/containers/generate_order_form'; import { localStorage } from 'ts/local_storage/local_storage'; import { Dispatcher } from 'ts/redux/dispatcher'; -import { portalOrderSchema } from 'ts/schemas/portal_order_schema'; -import { validator } from 'ts/schemas/validator'; import { BlockchainErrs, - Environments, HashData, Order, ProviderType, diff --git a/packages/website/ts/components/legacy_portal/legacy_portal_menu.tsx b/packages/website/ts/components/legacy_portal/legacy_portal_menu.tsx index 7469ca14e..1dd164f8b 100644 --- a/packages/website/ts/components/legacy_portal/legacy_portal_menu.tsx +++ b/packages/website/ts/components/legacy_portal/legacy_portal_menu.tsx @@ -1,8 +1,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import { MenuItem } from 'ts/components/ui/menu_item'; -import { Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; +import { WebsitePaths } from 'ts/types'; export interface LegacyPortalMenuProps { menuItemStyle: React.CSSProperties; diff --git a/packages/website/ts/components/onboarding/onboarding_flow.tsx b/packages/website/ts/components/onboarding/onboarding_flow.tsx index 4066babaf..9879cd387 100644 --- a/packages/website/ts/components/onboarding/onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/onboarding_flow.tsx @@ -1,11 +1,9 @@ -import * as _ from 'lodash'; import * as React from 'react'; import { Placement, Popper, PopperChildrenProps } from 'react-popper'; import { ContinueButtonDisplay, OnboardingTooltip } from 'ts/components/onboarding/onboarding_tooltip'; import { Container } from 'ts/components/ui/container'; import { Overlay } from 'ts/components/ui/overlay'; -import { zIndex } from 'ts/utils/style'; export interface Step { target: string; diff --git a/packages/website/ts/components/onboarding/onboarding_tooltip.tsx b/packages/website/ts/components/onboarding/onboarding_tooltip.tsx index eb34a87f2..155c70c5f 100644 --- a/packages/website/ts/components/onboarding/onboarding_tooltip.tsx +++ b/packages/website/ts/components/onboarding/onboarding_tooltip.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; -import { colors } from '@0xproject/react-shared'; import { Container } from 'ts/components/ui/container'; import { Island } from 'ts/components/ui/island'; diff --git a/packages/website/ts/components/portal/menu.tsx b/packages/website/ts/components/portal/menu.tsx index 6e97ee37e..b0710de60 100644 --- a/packages/website/ts/components/portal/menu.tsx +++ b/packages/website/ts/components/portal/menu.tsx @@ -2,9 +2,8 @@ import { Styles } from '@0xproject/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; import { MenuItem } from 'ts/components/ui/menu_item'; -import { Environments, WebsitePaths } from 'ts/types'; +import { WebsitePaths } from 'ts/types'; import { colors } from 'ts/utils/colors'; -import { configs } from 'ts/utils/configs'; export interface MenuTheme { paddingLeft: number; diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index 9aa83546a..088b33c90 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -3,7 +3,7 @@ import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; import * as React from 'react'; import * as DocumentTitle from 'react-document-title'; -import { Link, Route, RouteComponentProps, Switch } from 'react-router-dom'; +import { Route, RouteComponentProps, Switch } from 'react-router-dom'; import { Blockchain } from 'ts/blockchain'; import { BlockchainErrDialog } from 'ts/components/dialogs/blockchain_err_dialog'; diff --git a/packages/website/ts/components/portal/section.tsx b/packages/website/ts/components/portal/section.tsx index 9b172aae0..455ed07c9 100644 --- a/packages/website/ts/components/portal/section.tsx +++ b/packages/website/ts/components/portal/section.tsx @@ -1,4 +1,3 @@ -import { Styles } from '@0xproject/react-shared'; import * as React from 'react'; export interface SectionProps { diff --git a/packages/website/ts/components/redirecter.tsx b/packages/website/ts/components/redirecter.tsx index 629522bbb..07432a926 100644 --- a/packages/website/ts/components/redirecter.tsx +++ b/packages/website/ts/components/redirecter.tsx @@ -1,4 +1,3 @@ -import * as React from 'react'; import { constants } from 'ts/utils/constants'; interface RedirecterProps { diff --git a/packages/website/ts/components/relayer_index/relayer_grid_tile.tsx b/packages/website/ts/components/relayer_index/relayer_grid_tile.tsx index ad6ab3de1..62f251e89 100644 --- a/packages/website/ts/components/relayer_index/relayer_grid_tile.tsx +++ b/packages/website/ts/components/relayer_index/relayer_grid_tile.tsx @@ -6,8 +6,7 @@ import * as React from 'react'; import { TopTokens } from 'ts/components/relayer_index/relayer_top_tokens'; import { Container } from 'ts/components/ui/container'; import { Island } from 'ts/components/ui/island'; -import { TokenIcon } from 'ts/components/ui/token_icon'; -import { Token, WebsiteBackendRelayerInfo } from 'ts/types'; +import { WebsiteBackendRelayerInfo } from 'ts/types'; import { colors } from 'ts/utils/colors'; export interface RelayerGridTileProps { diff --git a/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx b/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx index e42f8a81a..a5754180b 100644 --- a/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx +++ b/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx @@ -2,7 +2,6 @@ import { colors, EtherscanLinkSuffixes, Styles, utils as sharedUtils } from '@0x import * as _ from 'lodash'; import * as React from 'react'; -import { TokenIcon } from 'ts/components/ui/token_icon'; import { WebsiteBackendTokenInfo } from 'ts/types'; export interface TopTokensProps { diff --git a/packages/website/ts/components/sidebar_header.tsx b/packages/website/ts/components/sidebar_header.tsx index bf46caad9..a14ab54f5 100644 --- a/packages/website/ts/components/sidebar_header.tsx +++ b/packages/website/ts/components/sidebar_header.tsx @@ -1,9 +1,6 @@ import { colors } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; -const SHOW_DURATION_MS = 4000; - interface SidebarHeaderProps { title: string; iconUrl: string; diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index 7a0742bbe..00c45961e 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -13,7 +13,6 @@ import Dialog from 'material-ui/Dialog'; import Divider from 'material-ui/Divider'; import FlatButton from 'material-ui/FlatButton'; import FloatingActionButton from 'material-ui/FloatingActionButton'; -import RaisedButton from 'material-ui/RaisedButton'; import ContentAdd from 'material-ui/svg-icons/content/add'; import ContentRemove from 'material-ui/svg-icons/content/remove'; import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table'; @@ -169,7 +168,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala />, ]; const isTestNetwork = utils.isTestNetwork(this.props.networkId); - const isKovanTestNetwork = this.props.networkId === constants.NETWORK_ID_KOVAN; const stubColumnStyle = { display: isTestNetwork ? 'none' : 'table-cell', }; diff --git a/packages/website/ts/components/top_bar/provider_display.tsx b/packages/website/ts/components/top_bar/provider_display.tsx index 8a337119a..b48d6b70b 100644 --- a/packages/website/ts/components/top_bar/provider_display.tsx +++ b/packages/website/ts/components/top_bar/provider_display.tsx @@ -12,7 +12,6 @@ import { Dispatcher } from 'ts/redux/dispatcher'; import { ProviderType } from 'ts/types'; import { colors } from 'ts/utils/colors'; import { constants } from 'ts/utils/constants'; -import { zIndex } from 'ts/utils/style'; import { utils } from 'ts/utils/utils'; const ROOT_HEIGHT = 24; diff --git a/packages/website/ts/components/top_bar/provider_picker.tsx b/packages/website/ts/components/top_bar/provider_picker.tsx index 1ecb8389c..7937f2e9d 100644 --- a/packages/website/ts/components/top_bar/provider_picker.tsx +++ b/packages/website/ts/components/top_bar/provider_picker.tsx @@ -1,11 +1,9 @@ import { colors, constants as sharedConstants } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import { RadioButton, RadioButtonGroup } from 'material-ui/RadioButton'; import * as React from 'react'; import { Blockchain } from 'ts/blockchain'; import { Dispatcher } from 'ts/redux/dispatcher'; import { ProviderType } from 'ts/types'; -import { constants } from 'ts/utils/constants'; interface ProviderPickerProps { networkId: number; diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx index e2d791ae3..fc9553a07 100644 --- a/packages/website/ts/components/top_bar/top_bar.tsx +++ b/packages/website/ts/components/top_bar/top_bar.tsx @@ -6,15 +6,12 @@ import Menu from 'material-ui/Menu'; import MenuItem from 'material-ui/MenuItem'; import * as React from 'react'; import { Link } from 'react-router-dom'; -import ReactTooltip = require('react-tooltip'); import { Blockchain } from 'ts/blockchain'; import { LegacyPortalMenu } from 'ts/components/legacy_portal/legacy_portal_menu'; import { DrawerMenu } from 'ts/components/portal/drawer_menu'; -import { SidebarHeader } from 'ts/components/sidebar_header'; import { ProviderDisplay } from 'ts/components/top_bar/provider_display'; import { TopBarMenuItem } from 'ts/components/top_bar/top_bar_menu_item'; import { DropDown } from 'ts/components/ui/drop_down'; -import { Identicon } from 'ts/components/ui/identicon'; import { Dispatcher } from 'ts/redux/dispatcher'; import { Deco, Key, ProviderType, WebsiteLegacyPaths, WebsitePaths } from 'ts/types'; import { constants } from 'ts/utils/constants'; @@ -418,8 +415,6 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> { ) { return undefined; } - - const sectionTitle = `${this.props.docsInfo.displayName} Docs`; return ( <div className="lg-hide md-hide"> <NestedSidebarMenu diff --git a/packages/website/ts/components/ui/copy_icon.tsx b/packages/website/ts/components/ui/copy_icon.tsx index 2c2941067..0330d1843 100644 --- a/packages/website/ts/components/ui/copy_icon.tsx +++ b/packages/website/ts/components/ui/copy_icon.tsx @@ -1,5 +1,4 @@ import { colors } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; import * as CopyToClipboard from 'react-copy-to-clipboard'; import * as ReactDOM from 'react-dom'; diff --git a/packages/website/ts/components/ui/drop_down.tsx b/packages/website/ts/components/ui/drop_down.tsx index 98a495581..db79ca1df 100644 --- a/packages/website/ts/components/ui/drop_down.tsx +++ b/packages/website/ts/components/ui/drop_down.tsx @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import Popover, { PopoverAnimationVertical } from 'material-ui/Popover'; import * as React from 'react'; import { MaterialUIPosition } from 'ts/types'; diff --git a/packages/website/ts/components/ui/etherscan_icon.tsx b/packages/website/ts/components/ui/etherscan_icon.tsx index 1b032c112..0beb69123 100644 --- a/packages/website/ts/components/ui/etherscan_icon.tsx +++ b/packages/website/ts/components/ui/etherscan_icon.tsx @@ -2,7 +2,6 @@ import { colors, EtherscanLinkSuffixes, utils as sharedUtils } from '@0xproject/ import * as _ from 'lodash'; import * as React from 'react'; import ReactTooltip = require('react-tooltip'); -import { utils } from 'ts/utils/utils'; interface EtherScanIconProps { addressOrTxHash: string; diff --git a/packages/website/ts/components/ui/island.tsx b/packages/website/ts/components/ui/island.tsx index f5480c9c9..6b8d39cb8 100644 --- a/packages/website/ts/components/ui/island.tsx +++ b/packages/website/ts/components/ui/island.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Styleable } from 'ts/types'; import { colors } from 'ts/utils/colors'; export interface IslandProps { diff --git a/packages/website/ts/components/ui/lifecycle_raised_button.tsx b/packages/website/ts/components/ui/lifecycle_raised_button.tsx index b06978f16..0c3ebcc0c 100644 --- a/packages/website/ts/components/ui/lifecycle_raised_button.tsx +++ b/packages/website/ts/components/ui/lifecycle_raised_button.tsx @@ -1,5 +1,4 @@ import { colors } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import RaisedButton from 'material-ui/RaisedButton'; import * as React from 'react'; import { utils } from 'ts/utils/utils'; diff --git a/packages/website/ts/components/ui/overlay.tsx b/packages/website/ts/components/ui/overlay.tsx index bb2ed8e59..961f7496a 100644 --- a/packages/website/ts/components/ui/overlay.tsx +++ b/packages/website/ts/components/ui/overlay.tsx @@ -1,4 +1,3 @@ -import { colors } from '@0xproject/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; diff --git a/packages/website/ts/components/ui/party.tsx b/packages/website/ts/components/ui/party.tsx index 0d86a6db5..a25550475 100644 --- a/packages/website/ts/components/ui/party.tsx +++ b/packages/website/ts/components/ui/party.tsx @@ -4,7 +4,6 @@ import * as React from 'react'; import ReactTooltip = require('react-tooltip'); import { EthereumAddress } from 'ts/components/ui/ethereum_address'; import { Identicon } from 'ts/components/ui/identicon'; -import { utils } from 'ts/utils/utils'; const IMAGE_DIMENSION = 100; const IDENTICON_DIAMETER = 95; diff --git a/packages/website/ts/components/ui/swap_icon.tsx b/packages/website/ts/components/ui/swap_icon.tsx index 4a6000d1b..f1d1ae7d4 100644 --- a/packages/website/ts/components/ui/swap_icon.tsx +++ b/packages/website/ts/components/ui/swap_icon.tsx @@ -1,5 +1,4 @@ import { colors } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; interface SwapIconProps { diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx index 7059ca350..c55cb1ab4 100644 --- a/packages/website/ts/components/wallet/wallet.tsx +++ b/packages/website/ts/components/wallet/wallet.tsx @@ -1,25 +1,15 @@ -import { - constants as sharedConstants, - EtherscanLinkSuffixes, - Styles, - utils as sharedUtils, -} from '@0xproject/react-shared'; +import { EtherscanLinkSuffixes, Styles, utils as sharedUtils } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; -import FlatButton from 'material-ui/FlatButton'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import { ListItem } from 'material-ui/List'; import ActionAccountBalanceWallet from 'material-ui/svg-icons/action/account-balance-wallet'; import ContentAdd from 'material-ui/svg-icons/content/add'; import ContentRemove from 'material-ui/svg-icons/content/remove'; -import NavigationArrowDownward from 'material-ui/svg-icons/navigation/arrow-downward'; -import NavigationArrowUpward from 'material-ui/svg-icons/navigation/arrow-upward'; -import Close from 'material-ui/svg-icons/navigation/close'; import * as React from 'react'; import { Link } from 'react-router-dom'; -import ReactTooltip = require('react-tooltip'); import firstBy = require('thenby'); import { Blockchain } from 'ts/blockchain'; @@ -33,9 +23,7 @@ import { WalletDisconnectedItem } from 'ts/components/wallet/wallet_disconnected import { WrapEtherItem } from 'ts/components/wallet/wrap_ether_item'; import { Dispatcher } from 'ts/redux/dispatcher'; import { - BalanceErrs, BlockchainErrs, - ItemByAddress, ProviderType, ScreenWidths, Side, @@ -45,7 +33,6 @@ import { TokenStateByAddress, WebsitePaths, } from 'ts/types'; -import { backendClient } from 'ts/utils/backend_client'; import { colors } from 'ts/utils/colors'; import { constants } from 'ts/utils/constants'; import { zIndex } from 'ts/utils/style'; @@ -148,10 +135,8 @@ const NO_ALLOWANCE_TOGGLE_SPACE_WIDTH = 56; const ACCOUNT_PATH = `${WebsitePaths.Portal}/account`; export class Wallet extends React.Component<WalletProps, WalletState> { - private _isUnmounted: boolean; constructor(props: WalletProps) { super(props); - this._isUnmounted = false; this.state = { wrappedEtherDirection: undefined, isHoveringSidebar: false, @@ -185,7 +170,6 @@ export class Wallet extends React.Component<WalletProps, WalletState> { ); } private _renderDisconnectedHeaderRows(): React.ReactElement<{}> { - const userAddress = this.props.userAddress; const primaryText = 'wallet'; return ( <StandardIconRow @@ -512,45 +496,6 @@ export class Wallet extends React.Component<WalletProps, WalletState> { <IconButton iconName={buttonIconName} labelText={buttonLabel} onClick={onClick} color={colors.mediumBlue} /> ); } - private _getInitialTrackedTokenStateByAddress(tokenAddresses: string[]): TokenStateByAddress { - const trackedTokenStateByAddress: TokenStateByAddress = {}; - _.each(tokenAddresses, tokenAddress => { - trackedTokenStateByAddress[tokenAddress] = { - balance: new BigNumber(0), - allowance: new BigNumber(0), - isLoaded: false, - }; - }); - return trackedTokenStateByAddress; - } - - private async _getPriceByAddressAsync(tokenAddresses: string[]): Promise<ItemByAddress<BigNumber>> { - if (_.isEmpty(tokenAddresses)) { - return {}; - } - // for each input token address, search for the corresponding symbol in this.props.tokenByAddress, if it exists - // create a mapping from existing symbols -> address - const tokenAddressBySymbol: { [symbol: string]: string } = {}; - _.each(tokenAddresses, address => { - const tokenIfExists = _.get(this.props.tokenByAddress, address); - if (!_.isUndefined(tokenIfExists)) { - const symbol = tokenIfExists.symbol; - tokenAddressBySymbol[symbol] = address; - } - }); - const tokenSymbols = _.keys(tokenAddressBySymbol); - try { - const priceBySymbol = await backendClient.getPriceInfoAsync(tokenSymbols); - const priceByAddress = _.mapKeys(priceBySymbol, (value, symbol) => _.get(tokenAddressBySymbol, symbol)); - const result = _.mapValues(priceByAddress, price => { - const priceBigNumber = new BigNumber(price); - return priceBigNumber; - }); - return result; - } catch (err) { - return {}; - } - } private _openWrappedEtherActionRow(wrappedEtherDirection: Side): void { this.setState({ wrappedEtherDirection, diff --git a/packages/website/ts/components/wallet/wallet_disconnected_item.tsx b/packages/website/ts/components/wallet/wallet_disconnected_item.tsx index 17fd8a19e..b719dd504 100644 --- a/packages/website/ts/components/wallet/wallet_disconnected_item.tsx +++ b/packages/website/ts/components/wallet/wallet_disconnected_item.tsx @@ -1,6 +1,5 @@ import { Styles } from '@0xproject/react-shared'; import FlatButton from 'material-ui/FlatButton'; -import ActionAccountBalanceWallet from 'material-ui/svg-icons/action/account-balance-wallet'; import * as React from 'react'; import { ProviderType } from 'ts/types'; diff --git a/packages/website/ts/components/wallet/wrap_ether_item.tsx b/packages/website/ts/components/wallet/wrap_ether_item.tsx index 1dfcffadf..376829f4e 100644 --- a/packages/website/ts/components/wallet/wrap_ether_item.tsx +++ b/packages/website/ts/components/wallet/wrap_ether_item.tsx @@ -3,7 +3,6 @@ import { BigNumber, logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import FlatButton from 'material-ui/FlatButton'; -import { ListItem } from 'material-ui/List'; import * as React from 'react'; import { Blockchain } from 'ts/blockchain'; diff --git a/packages/website/ts/containers/about.ts b/packages/website/ts/containers/about.ts index ce8fd3afb..3dbdcd16b 100644 --- a/packages/website/ts/containers/about.ts +++ b/packages/website/ts/containers/about.ts @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; diff --git a/packages/website/ts/containers/connect_documentation.ts b/packages/website/ts/containers/connect_documentation.ts index 698d605c9..2ecd8107a 100644 --- a/packages/website/ts/containers/connect_documentation.ts +++ b/packages/website/ts/containers/connect_documentation.ts @@ -1,13 +1,11 @@ import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; +import { DocPackages } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; diff --git a/packages/website/ts/containers/faq.ts b/packages/website/ts/containers/faq.ts index b539e33c9..b91c47889 100644 --- a/packages/website/ts/containers/faq.ts +++ b/packages/website/ts/containers/faq.ts @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; diff --git a/packages/website/ts/containers/generate_order_form.ts b/packages/website/ts/containers/generate_order_form.ts index 98c9b8cd6..b4c6cc0d4 100644 --- a/packages/website/ts/containers/generate_order_form.ts +++ b/packages/website/ts/containers/generate_order_form.ts @@ -1,6 +1,5 @@ import { ECSignature } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Blockchain } from 'ts/blockchain'; diff --git a/packages/website/ts/containers/json_schemas_documentation.ts b/packages/website/ts/containers/json_schemas_documentation.ts index 154c65ffc..4df7ddecb 100644 --- a/packages/website/ts/containers/json_schemas_documentation.ts +++ b/packages/website/ts/containers/json_schemas_documentation.ts @@ -1,14 +1,11 @@ -import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; -import * as _ from 'lodash'; +import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; -import { constants } from 'ts/utils/constants'; +import { DocPackages } from 'ts/types'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ diff --git a/packages/website/ts/containers/landing.ts b/packages/website/ts/containers/landing.ts index a620bb12e..a9fc1d9d1 100644 --- a/packages/website/ts/containers/landing.ts +++ b/packages/website/ts/containers/landing.ts @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; diff --git a/packages/website/ts/containers/not_found.ts b/packages/website/ts/containers/not_found.ts index dd151e2c8..4fdc325ea 100644 --- a/packages/website/ts/containers/not_found.ts +++ b/packages/website/ts/containers/not_found.ts @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; diff --git a/packages/website/ts/containers/order_utils_documentation.ts b/packages/website/ts/containers/order_utils_documentation.ts index 64aa7300f..cdf97e5c8 100644 --- a/packages/website/ts/containers/order_utils_documentation.ts +++ b/packages/website/ts/containers/order_utils_documentation.ts @@ -1,13 +1,11 @@ -import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; -import * as _ from 'lodash'; +import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; +import { DocPackages } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; diff --git a/packages/website/ts/containers/smart_contracts_documentation.ts b/packages/website/ts/containers/smart_contracts_documentation.ts index b1b2ea922..27328909c 100644 --- a/packages/website/ts/containers/smart_contracts_documentation.ts +++ b/packages/website/ts/containers/smart_contracts_documentation.ts @@ -1,13 +1,12 @@ import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; import { Networks } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, SmartContractDocSections as Sections, WebsitePaths } from 'ts/types'; +import { DocPackages, SmartContractDocSections as Sections } from 'ts/types'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ diff --git a/packages/website/ts/containers/sol_compiler_documentation.ts b/packages/website/ts/containers/sol_compiler_documentation.ts index 2f6486146..4ccc1850f 100644 --- a/packages/website/ts/containers/sol_compiler_documentation.ts +++ b/packages/website/ts/containers/sol_compiler_documentation.ts @@ -1,14 +1,11 @@ import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; -import { constants } from 'ts/utils/constants'; +import { DocPackages } from 'ts/types'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ diff --git a/packages/website/ts/containers/sol_cov_documentation.ts b/packages/website/ts/containers/sol_cov_documentation.ts index bc05b6854..73cc99a8c 100644 --- a/packages/website/ts/containers/sol_cov_documentation.ts +++ b/packages/website/ts/containers/sol_cov_documentation.ts @@ -1,14 +1,11 @@ import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; -import { constants } from 'ts/utils/constants'; +import { DocPackages } from 'ts/types'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ diff --git a/packages/website/ts/containers/subproviders_documentation.ts b/packages/website/ts/containers/subproviders_documentation.ts index 2178baea8..0c7e73f38 100644 --- a/packages/website/ts/containers/subproviders_documentation.ts +++ b/packages/website/ts/containers/subproviders_documentation.ts @@ -1,13 +1,11 @@ import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; +import { DocPackages } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; diff --git a/packages/website/ts/containers/web3_wrapper_documentation.ts b/packages/website/ts/containers/web3_wrapper_documentation.ts index 17754ca66..34633f14d 100644 --- a/packages/website/ts/containers/web3_wrapper_documentation.ts +++ b/packages/website/ts/containers/web3_wrapper_documentation.ts @@ -1,13 +1,11 @@ import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; +import { DocPackages } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; diff --git a/packages/website/ts/containers/wiki.ts b/packages/website/ts/containers/wiki.ts index 2cb87d0a1..af7228dbe 100644 --- a/packages/website/ts/containers/wiki.ts +++ b/packages/website/ts/containers/wiki.ts @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts index f68e2335f..94efd1cf7 100644 --- a/packages/website/ts/containers/zero_ex_js_documentation.ts +++ b/packages/website/ts/containers/zero_ex_js_documentation.ts @@ -1,13 +1,11 @@ import { constants as docConstants, DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs'; -import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; import { Dispatch } from 'redux'; import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; import { Dispatcher } from 'ts/redux/dispatcher'; import { State } from 'ts/redux/reducer'; -import { DocPackages, Environments, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; +import { DocPackages } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; diff --git a/packages/website/ts/pages/about/about.tsx b/packages/website/ts/pages/about/about.tsx index ac67ca968..3136dbca3 100644 --- a/packages/website/ts/pages/about/about.tsx +++ b/packages/website/ts/pages/about/about.tsx @@ -8,7 +8,6 @@ import { TopBar } from 'ts/components/top_bar/top_bar'; import { Profile } from 'ts/pages/about/profile'; import { Dispatcher } from 'ts/redux/dispatcher'; import { ProfileInfo, WebsitePaths } from 'ts/types'; -import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; import { utils } from 'ts/utils/utils'; diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 17efc56ed..4dffa13f1 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -1,5 +1,4 @@ -import { DocAgnosticFormat, DocsInfo, Documentation, DoxityDocObj } from '@0xproject/react-docs'; -import { MenuSubsectionsBySection } from '@0xproject/react-shared'; +import { DocAgnosticFormat, DocsInfo, Documentation } from '@0xproject/react-docs'; import findVersions = require('find-versions'); import * as _ from 'lodash'; import * as React from 'react'; @@ -9,7 +8,6 @@ import { SidebarHeader } from 'ts/components/sidebar_header'; import { TopBar } from 'ts/components/top_bar/top_bar'; import { Dispatcher } from 'ts/redux/dispatcher'; import { DocPackages } from 'ts/types'; -import { configs } from 'ts/utils/configs'; import { constants } from 'ts/utils/constants'; import { docUtils } from 'ts/utils/doc_utils'; import { Translate } from 'ts/utils/translate'; diff --git a/packages/website/ts/pages/faq/question.tsx b/packages/website/ts/pages/faq/question.tsx index 28ea6881a..f80985257 100644 --- a/packages/website/ts/pages/faq/question.tsx +++ b/packages/website/ts/pages/faq/question.tsx @@ -1,5 +1,4 @@ import { colors } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import { Card, CardHeader, CardText } from 'material-ui/Card'; import * as React from 'react'; diff --git a/packages/website/ts/pages/landing/landing.tsx b/packages/website/ts/pages/landing/landing.tsx index 02ecfa117..f751e31f3 100644 --- a/packages/website/ts/pages/landing/landing.tsx +++ b/packages/website/ts/pages/landing/landing.tsx @@ -7,7 +7,7 @@ import { Link } from 'react-router-dom'; import { Footer } from 'ts/components/footer'; import { TopBar } from 'ts/components/top_bar/top_bar'; import { Dispatcher } from 'ts/redux/dispatcher'; -import { Deco, Key, Language, ScreenWidths, WebsitePaths } from 'ts/types'; +import { Deco, Key, ScreenWidths, WebsitePaths } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; import { utils } from 'ts/utils/utils'; @@ -806,7 +806,4 @@ export class Landing extends React.Component<LandingProps, LandingState> { }); } } - private _onLanguageSelected(language: Language): void { - this.props.dispatcher.updateSelectedLanguage(language); - } } // tslint:disable:max-file-line-count diff --git a/packages/website/ts/pages/not_found.tsx b/packages/website/ts/pages/not_found.tsx index 674271636..a94ba5863 100644 --- a/packages/website/ts/pages/not_found.tsx +++ b/packages/website/ts/pages/not_found.tsx @@ -1,5 +1,3 @@ -import { Styles } from '@0xproject/react-shared'; -import * as _ from 'lodash'; import * as React from 'react'; import { Footer } from 'ts/components/footer'; import { TopBar } from 'ts/components/top_bar/top_bar'; diff --git a/packages/website/ts/pages/wiki/wiki.tsx b/packages/website/ts/pages/wiki/wiki.tsx index 720c1cc37..bdefe0fda 100644 --- a/packages/website/ts/pages/wiki/wiki.tsx +++ b/packages/website/ts/pages/wiki/wiki.tsx @@ -4,23 +4,19 @@ import { HeaderSizes, MarkdownSection, NestedSidebarMenu, - SectionHeader, Styles, utils as sharedUtils, } from '@0xproject/react-shared'; -import { logUtils } from '@0xproject/utils'; import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import RaisedButton from 'material-ui/RaisedButton'; import * as React from 'react'; import DocumentTitle = require('react-document-title'); -import { scroller } from 'react-scroll'; import { SidebarHeader } from 'ts/components/sidebar_header'; import { TopBar } from 'ts/components/top_bar/top_bar'; import { Dispatcher } from 'ts/redux/dispatcher'; -import { Article, ArticlesBySection, WebsitePaths } from 'ts/types'; +import { Article, ArticlesBySection } from 'ts/types'; import { backendClient } from 'ts/utils/backend_client'; -import { configs } from 'ts/utils/configs'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; import { utils } from 'ts/utils/utils'; diff --git a/packages/website/ts/schemas/validator.ts b/packages/website/ts/schemas/validator.ts index dac0f0098..3fd013002 100644 --- a/packages/website/ts/schemas/validator.ts +++ b/packages/website/ts/schemas/validator.ts @@ -1,5 +1,4 @@ import { SchemaValidator } from '@0xproject/json-schemas'; -import { Schema as JSONSchema, Validator } from 'jsonschema'; import { orderMetadataSchema } from 'ts/schemas/metadata_schema'; import { portalOrderSchema } from 'ts/schemas/portal_order_schema'; import { portalTokenMetadataSchema } from 'ts/schemas/portal_token_metadata'; diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts index 9567e129b..5481e90be 100644 --- a/packages/website/ts/types.ts +++ b/packages/website/ts/types.ts @@ -1,6 +1,5 @@ import { ECSignature } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; import * as React from 'react'; export enum Side { diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index e72a7f201..ace8a5ba0 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -1,6 +1,5 @@ import * as _ from 'lodash'; import { Environments, OutdatedWrappedEtherByNetworkId, PublicNodeUrlsByNetworkId } from 'ts/types'; -import { utils } from 'ts/utils/utils'; const BASE_URL = window.location.origin; const isDevelopment = _.includes( diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts index 9dc1d492c..d281c5738 100644 --- a/packages/website/ts/utils/constants.ts +++ b/packages/website/ts/utils/constants.ts @@ -1,4 +1,3 @@ -import { Networks } from '@0xproject/react-shared'; import { BigNumber } from '@0xproject/utils'; export const constants = { diff --git a/packages/website/ts/utils/doc_utils.ts b/packages/website/ts/utils/doc_utils.ts index 2a599bcbe..019a29f5c 100644 --- a/packages/website/ts/utils/doc_utils.ts +++ b/packages/website/ts/utils/doc_utils.ts @@ -3,7 +3,6 @@ import { logUtils } from '@0xproject/utils'; import findVersions = require('find-versions'); import * as _ from 'lodash'; import { S3FileObject, VersionToFilePath } from 'ts/types'; -import { utils } from 'ts/utils/utils'; import convert = require('xml-js'); export const docUtils = { diff --git a/packages/website/ts/utils/error_reporter.ts b/packages/website/ts/utils/error_reporter.ts index 19f563880..548d4d41d 100644 --- a/packages/website/ts/utils/error_reporter.ts +++ b/packages/website/ts/utils/error_reporter.ts @@ -2,7 +2,6 @@ import { logUtils } from '@0xproject/utils'; import { Environments } from 'ts/types'; import { configs } from 'ts/utils/configs'; import { constants } from 'ts/utils/constants'; -import { utils } from 'ts/utils/utils'; // Suggested way to include Rollbar with Webpack // https://github.com/rollbar/rollbar.js/tree/master/examples/webpack diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index b9d962b75..2c8c06c01 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -1,6 +1,6 @@ import { ContractWrappersError, ExchangeContractErrs } from '@0xproject/contract-wrappers'; import { OrderError } from '@0xproject/order-utils'; -import { constants as sharedConstants, EtherscanLinkSuffixes, Networks } from '@0xproject/react-shared'; +import { constants as sharedConstants, Networks } from '@0xproject/react-shared'; import { ECSignature, Provider } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import deepEqual = require('deep-equal'); |