Fix no-unused-variable tslint rule to include parameters and fix issues

This commit is contained in:
Fabio Berger 2018-06-11 23:42:30 +02:00
parent b6df727efb
commit e1879ef4d9
66 changed files with 104 additions and 113 deletions

View File

@ -37,7 +37,7 @@ export class BaseContract {
protected static _lowercaseAddress(type: string, value: string): string { protected static _lowercaseAddress(type: string, value: string): string {
return type === 'address' ? value.toLowerCase() : value; return type === 'address' ? value.toLowerCase() : value;
} }
protected static _bigNumberToString(type: string, value: any): any { protected static _bigNumberToString(_type: string, value: any): any {
return _.isObject(value) && value.isBigNumber ? value.toString() : value; return _.isObject(value) && value.isBigNumber ? value.toString() : value;
} }
protected static _lookupConstructorAbi(abi: ContractAbi): ConstructorAbi { protected static _lookupConstructorAbi(abi: ContractAbi): ConstructorAbi {
@ -60,7 +60,7 @@ export class BaseContract {
return defaultConstructorAbi; return defaultConstructorAbi;
} }
} }
protected static _bnToBigNumber(type: string, value: any): any { protected static _bnToBigNumber(_type: string, value: any): any {
return _.isObject(value) && value._bn ? new BigNumber(value.toString()) : value; return _.isObject(value) && value._bn ? new BigNumber(value.toString()) : value;
} }
protected static async _applyDefaultsToTxDataAsync<T extends Partial<TxData | TxDataPayable>>( protected static async _applyDefaultsToTxDataAsync<T extends Partial<TxData | TxDataPayable>>(

View File

@ -48,7 +48,7 @@ export class HttpClient implements Client {
return ''; return '';
} }
// format params into a form the api expects // format params into a form the api expects
const formattedParams = _.mapKeys(params, (value: any, key: string) => { const formattedParams = _.mapKeys(params, (_value: any, key: string) => {
return _.get(OPTS_TO_QUERY_FIELD_MAP, key, key); return _.get(OPTS_TO_QUERY_FIELD_MAP, key, key);
}); });
// stringify the formatted object // stringify the formatted object

View File

@ -78,7 +78,7 @@ export class WebSocketOrderbookChannel implements OrderbookChannel {
connection.on(WebsocketConnectionEventType.Error, wsError => { connection.on(WebsocketConnectionEventType.Error, wsError => {
handler.onError(this, subscriptionOpts, wsError); handler.onError(this, subscriptionOpts, wsError);
}); });
connection.on(WebsocketConnectionEventType.Close, (code: number, desc: string) => { connection.on(WebsocketConnectionEventType.Close, (_code: number, _desc: string) => {
handler.onClose(this, subscriptionOpts); handler.onClose(this, subscriptionOpts);
}); });
connection.on(WebsocketConnectionEventType.Message, message => { connection.on(WebsocketConnectionEventType.Message, message => {

View File

@ -24,7 +24,7 @@
"clean": "shx rm -rf lib src/generated_contract_wrappers", "clean": "shx rm -rf lib src/generated_contract_wrappers",
"generate_contract_wrappers": "generate_contract_wrappers":
"abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers", "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers",
"lint": "tslint --project . --exclude **/src/contract_wrappers/**/* --exclude **/lib/**/*", "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/* --exclude **/lib/**/*",
"coverage:report:text": "istanbul report text", "coverage:report:text": "istanbul report text",
"coverage:report:html": "istanbul report html && open coverage/index.html", "coverage:report:html": "istanbul report html && open coverage/index.html",
"profiler:report:html": "istanbul report html && open coverage/index.html", "profiler:report:html": "istanbul report html && open coverage/index.html",

View File

@ -30,7 +30,7 @@ describe('LibMem', () => {
const memHex = toHex(memory); const memHex = toHex(memory);
// Reference implementation to test against // Reference implementation to test against
const refMemcpy = (mem: Uint8Array, dest: number, source: number, length: number): Uint8Array => const refMemcpy = (_mem: Uint8Array, dest: number, source: number, length: number): Uint8Array =>
Uint8Array.from(memory).copyWithin(dest, source, source + length); Uint8Array.from(memory).copyWithin(dest, source, source + length);
// Test vectors: destination, source, length, job description // Test vectors: destination, source, length, job description

View File

@ -60,7 +60,7 @@ export const callbackErrorReporter = {
done: DoneCallback, done: DoneCallback,
errMsg: string, errMsg: string,
): <T>(error: Error | null, value: T | undefined) => void { ): <T>(error: Error | null, value: T | undefined) => void {
const wrapped = <T>(error: Error | null, value: T | undefined) => { const wrapped = <T>(error: Error | null, _value: T | undefined) => {
if (_.isNull(error)) { if (_.isNull(error)) {
done(new Error('Expected callback to receive an error')); done(new Error('Expected callback to receive an error'));
} else { } else {

View File

@ -2,7 +2,6 @@ import { BlockchainLifecycle, devConstants } from '@0xproject/dev-utils';
import { ExchangeContractErrs } from '@0xproject/types'; import { ExchangeContractErrs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils'; import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai'; import * as chai from 'chai';
import * as _ from 'lodash';
import 'make-promises-safe'; import 'make-promises-safe';
import { artifacts } from '../src/artifacts'; import { artifacts } from '../src/artifacts';
@ -176,11 +175,3 @@ describe('ExchangeTransferSimulator', async () => {
}); });
}); });
}); });
function getAddressFromArtifact(artifact: any, networkId: number): string {
if (_.isUndefined(artifact.networks[networkId])) {
throw new Error(`Contract ${artifact.contractName} not deployed to network ${networkId}`);
}
const contractAddress = artifact.networks[networkId].address.toLowerCase();
return contractAddress;
}

View File

@ -11,14 +11,14 @@ export class SimpleERC20BalanceAndProxyAllowanceFetcher implements AbstractBalan
this._erc20TokenContract = erc20TokenWrapper; this._erc20TokenContract = erc20TokenWrapper;
this._erc20ProxyAddress = erc20ProxyAddress; this._erc20ProxyAddress = erc20ProxyAddress;
} }
public async getBalanceAsync(assetData: string, userAddress: string): Promise<BigNumber> { public async getBalanceAsync(_assetData: string, userAddress: string): Promise<BigNumber> {
// HACK: We cheat and don't pass in the userData since it's always the same token used // HACK: We cheat and don't pass in the assetData since it's always the same token used
// in our tests. // in our tests.
const balance = await this._erc20TokenContract.balanceOf.callAsync(userAddress); const balance = await this._erc20TokenContract.balanceOf.callAsync(userAddress);
return balance; return balance;
} }
public async getProxyAllowanceAsync(assetData: string, userAddress: string): Promise<BigNumber> { public async getProxyAllowanceAsync(_assetData: string, userAddress: string): Promise<BigNumber> {
// HACK: We cheat and don't pass in the userData since it's always the same token used // HACK: We cheat and don't pass in the assetData since it's always the same token used
// in our tests. // in our tests.
const proxyAllowance = await this._erc20TokenContract.allowance.callAsync(userAddress, this._erc20ProxyAddress); const proxyAllowance = await this._erc20TokenContract.allowance.callAsync(userAddress, this._erc20ProxyAddress);
return proxyAllowance; return proxyAllowance;

View File

@ -19,6 +19,8 @@ export class ExpirationWatcher {
private _expirationMarginMs: number; private _expirationMarginMs: number;
private _orderExpirationCheckingIntervalIdIfExists?: NodeJS.Timer; private _orderExpirationCheckingIntervalIdIfExists?: NodeJS.Timer;
constructor(expirationMarginIfExistsMs?: number, orderExpirationCheckingIntervalIfExistsMs?: number) { constructor(expirationMarginIfExistsMs?: number, orderExpirationCheckingIntervalIfExistsMs?: number) {
this._orderExpirationCheckingIntervalMs =
orderExpirationCheckingIntervalIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS;
this._expirationMarginMs = expirationMarginIfExistsMs || DEFAULT_EXPIRATION_MARGIN_MS; this._expirationMarginMs = expirationMarginIfExistsMs || DEFAULT_EXPIRATION_MARGIN_MS;
this._orderExpirationCheckingIntervalMs = this._orderExpirationCheckingIntervalMs =
expirationMarginIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS; expirationMarginIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS;

View File

@ -107,7 +107,7 @@ describe('ExpirationWatcher', () => {
); );
const orderHash = getOrderHashHex(signedOrder); const orderHash = getOrderHashHex(signedOrder);
expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND)); expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND));
const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done)(async (hash: string) => { const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done)(async (_hash: string) => {
done(new Error('Emitted expiration went before the order actually expired')); done(new Error('Emitted expiration went before the order actually expired'));
}); });
expirationWatcher.subscribe(callbackAsync); expirationWatcher.subscribe(callbackAsync);

View File

@ -159,7 +159,7 @@ describe('OrderWatcher', () => {
fillableAmount, fillableAmount,
); );
orderWatcher.addOrder(signedOrder); orderWatcher.addOrder(signedOrder);
const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((_orderState: OrderState) => {
throw new Error('OrderState callback fired for irrelevant order'); throw new Error('OrderState callback fired for irrelevant order');
}); });
orderWatcher.subscribe(callback); orderWatcher.subscribe(callback);

View File

@ -73,7 +73,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
public componentWillUnmount(): void { public componentWillUnmount(): void {
window.removeEventListener('hashchange', this._onHashChanged.bind(this), false); window.removeEventListener('hashchange', this._onHashChanged.bind(this), false);
} }
public componentDidUpdate(prevProps: DocumentationProps, prevState: DocumentationState): void { public componentDidUpdate(prevProps: DocumentationProps, _prevState: DocumentationState): void {
if (!_.isEqual(prevProps.docAgnosticFormat, this.props.docAgnosticFormat)) { if (!_.isEqual(prevProps.docAgnosticFormat, this.props.docAgnosticFormat)) {
const hash = window.location.hash.slice(1); const hash = window.location.hash.slice(1);
sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID); sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID);
@ -364,7 +364,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
/> />
); );
} }
private _onSidebarHover(event: React.FormEvent<HTMLInputElement>): void { private _onSidebarHover(_event: React.FormEvent<HTMLInputElement>): void {
this.setState({ this.setState({
isHoveringSidebar: true, isHoveringSidebar: true,
}); });
@ -374,7 +374,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
isHoveringSidebar: false, isHoveringSidebar: false,
}); });
} }
private _onHashChanged(event: any): void { private _onHashChanged(_event: any): void {
const hash = window.location.hash.slice(1); const hash = window.location.hash.slice(1);
sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID); sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID);
} }

View File

@ -8,7 +8,7 @@ export interface EnumProps {
} }
export const Enum = (props: EnumProps) => { export const Enum = (props: EnumProps) => {
const values = _.map(props.values, (value, i) => { const values = _.map(props.values, value => {
const defaultValueIfAny = !_.isUndefined(value.defaultValue) ? ` = ${value.defaultValue}` : ''; const defaultValueIfAny = !_.isUndefined(value.defaultValue) ? ` = ${value.defaultValue}` : '';
return `\n\t${value.name}${defaultValueIfAny},`; return `\n\t${value.name}${defaultValueIfAny},`;
}); });

View File

@ -11,7 +11,7 @@ export interface MarkdownCodeBlockState {}
export class MarkdownCodeBlock extends React.Component<MarkdownCodeBlockProps, MarkdownCodeBlockState> { export class MarkdownCodeBlock extends React.Component<MarkdownCodeBlockProps, MarkdownCodeBlockState> {
// Re-rendering a codeblock causes any use selection to become de-selected. This is annoying when trying // Re-rendering a codeblock causes any use selection to become de-selected. This is annoying when trying
// to copy-paste code examples. We therefore noop re-renders on this component if it's props haven't changed. // to copy-paste code examples. We therefore noop re-renders on this component if it's props haven't changed.
public shouldComponentUpdate(nextProps: MarkdownCodeBlockProps, nextState: MarkdownCodeBlockState): boolean { public shouldComponentUpdate(nextProps: MarkdownCodeBlockProps, _nextState: MarkdownCodeBlockState): boolean {
return nextProps.value !== this.props.value || nextProps.language !== this.props.language; return nextProps.value !== this.props.value || nextProps.language !== this.props.language;
} }
public render(): React.ReactNode { public render(): React.ReactNode {

View File

@ -13,7 +13,7 @@ export interface MarkdownLinkBlockState {}
export class MarkdownLinkBlock extends React.Component<MarkdownLinkBlockProps, MarkdownLinkBlockState> { export class MarkdownLinkBlock extends React.Component<MarkdownLinkBlockProps, MarkdownLinkBlockState> {
// Re-rendering a linkBlock causes it to remain unclickable. // Re-rendering a linkBlock causes it to remain unclickable.
// We therefore noop re-renders on this component if it's props haven't changed. // We therefore noop re-renders on this component if it's props haven't changed.
public shouldComponentUpdate(nextProps: MarkdownLinkBlockProps, nextState: MarkdownLinkBlockState): boolean { public shouldComponentUpdate(nextProps: MarkdownLinkBlockProps, _nextState: MarkdownLinkBlockState): boolean {
return nextProps.href !== this.props.href; return nextProps.href !== this.props.href;
} }
public render(): React.ReactNode { public render(): React.ReactNode {

View File

@ -31,7 +31,7 @@ export class VersionDropDown extends React.Component<VersionDropDownProps, Versi
}); });
return items; return items;
} }
private _updateSelectedVersion(e: any, index: number, semver: string): void { private _updateSelectedVersion(_e: any, _index: number, semver: string): void {
this.props.onVersionSelected(semver); this.props.onVersionSelected(semver);
} }
} }

View File

@ -73,7 +73,7 @@ export class TraceCollectionSubprovider extends Subprovider {
* @param end Callback to call if subprovider handled the request and wants to pass back the request. * @param end Callback to call if subprovider handled the request and wants to pass back the request.
*/ */
// tslint:disable-next-line:prefer-function-over-method async-suffix // tslint:disable-next-line:prefer-function-over-method async-suffix
public async handleRequest(payload: JSONRPCRequestPayload, next: NextCallback, end: ErrorCallback): Promise<void> { public async handleRequest(payload: JSONRPCRequestPayload, next: NextCallback, _end: ErrorCallback): Promise<void> {
if (this._isEnabled) { if (this._isEnabled) {
switch (payload.method) { switch (payload.method) {
case 'eth_sendTransaction': case 'eth_sendTransaction':
@ -155,8 +155,8 @@ export class TraceCollectionSubprovider extends Subprovider {
} }
private async _onCallOrGasEstimateExecutedAsync( private async _onCallOrGasEstimateExecutedAsync(
callData: Partial<CallData>, callData: Partial<CallData>,
err: Error | null, _err: Error | null,
callResult: string, _callResult: string,
cb: Callback, cb: Callback,
): Promise<void> { ): Promise<void> {
await this._recordCallOrGasEstimateTraceAsync(callData); await this._recordCallOrGasEstimateTraceAsync(callData);

View File

@ -28,7 +28,7 @@ export class GanacheSubprovider extends Subprovider {
* @param end Callback to call if subprovider handled the request and wants to pass back the request. * @param end Callback to call if subprovider handled the request and wants to pass back the request.
*/ */
// tslint:disable-next-line:prefer-function-over-method async-suffix // tslint:disable-next-line:prefer-function-over-method async-suffix
public async handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback): Promise<void> { public async handleRequest(payload: JSONRPCRequestPayload, _next: Callback, end: ErrorCallback): Promise<void> {
this._ganacheProvider.sendAsync(payload, (err: Error | null, result: any) => { this._ganacheProvider.sendAsync(payload, (err: Error | null, result: any) => {
end(err, result && result.result); end(err, result && result.result);
}); });

View File

@ -75,7 +75,7 @@ export class NonceTrackerSubprovider extends Subprovider {
return next(); return next();
} }
case 'eth_sendRawTransaction': case 'eth_sendRawTransaction':
return next((sendTransactionError: Error | null, txResult: any, cb: Callback) => { return next((sendTransactionError: Error | null, _txResult: any, cb: Callback) => {
if (_.isNull(sendTransactionError)) { if (_.isNull(sendTransactionError)) {
this._handleSuccessfulTransaction(payload); this._handleSuccessfulTransaction(payload);
} else { } else {

View File

@ -48,7 +48,7 @@ describe('LedgerSubprovider', () => {
}; };
return ecSignature; return ecSignature;
}, },
signTransaction: async (derivationPath: string, txHex: string) => { signTransaction: async (_derivationPath: string, _txHex: string) => {
const ecSignature = { const ecSignature = {
v: '77', v: '77',
r: '88a95ef1378487bc82be558e82c8478baf840c545d5b887536bb1da63673a98b', r: '88a95ef1378487bc82be558e82c8478baf840c545d5b887536bb1da63673a98b',
@ -193,7 +193,7 @@ describe('LedgerSubprovider', () => {
params: [FAKE_ADDRESS, nonHexMessage], params: [FAKE_ADDRESS, nonHexMessage],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world');
done(); done();
@ -208,7 +208,7 @@ describe('LedgerSubprovider', () => {
params: [nonHexMessage, FAKE_ADDRESS], params: [nonHexMessage, FAKE_ADDRESS],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world');
done(); done();
@ -226,7 +226,7 @@ describe('LedgerSubprovider', () => {
params: [tx], params: [tx],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied);
done(); done();
@ -245,7 +245,7 @@ describe('LedgerSubprovider', () => {
params: [tx], params: [tx],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied);
done(); done();

View File

@ -130,7 +130,7 @@ describe('MnemonicWalletSubprovider', () => {
params: [fixtureData.TEST_RPC_ACCOUNT_0, nonHexMessage], params: [fixtureData.TEST_RPC_ACCOUNT_0, nonHexMessage],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world');
done(); done();
@ -145,7 +145,7 @@ describe('MnemonicWalletSubprovider', () => {
params: [nonHexMessage, fixtureData.TEST_RPC_ACCOUNT_0], params: [nonHexMessage, fixtureData.TEST_RPC_ACCOUNT_0],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world');
done(); done();
@ -160,7 +160,7 @@ describe('MnemonicWalletSubprovider', () => {
params: [messageHex, fixtureData.NULL_ADDRESS], params: [messageHex, fixtureData.NULL_ADDRESS],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal( expect(err.message).to.be.equal(
`${WalletSubproviderErrors.AddressNotFound}: ${fixtureData.NULL_ADDRESS}`, `${WalletSubproviderErrors.AddressNotFound}: ${fixtureData.NULL_ADDRESS}`,
@ -180,7 +180,7 @@ describe('MnemonicWalletSubprovider', () => {
params: [tx], params: [tx],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied);
done(); done();
@ -199,7 +199,7 @@ describe('MnemonicWalletSubprovider', () => {
params: [tx], params: [tx],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied);
done(); done();

View File

@ -41,7 +41,7 @@ describe('NonceTrackerSubprovider', () => {
let isFirstGetTransactionCount = true; let isFirstGetTransactionCount = true;
const fixedBlockNumberAndTransactionCountProvider = new FixtureSubprovider({ const fixedBlockNumberAndTransactionCountProvider = new FixtureSubprovider({
eth_getBlockByNumber: '0x01', eth_getBlockByNumber: '0x01',
eth_getTransactionCount: (data: any, next: any, end: any) => { eth_getTransactionCount: (_data: any, _next: any, end: any) => {
// For testing caching we return different results on the second call // For testing caching we return different results on the second call
if (isFirstGetTransactionCount) { if (isFirstGetTransactionCount) {
isFirstGetTransactionCount = false; isFirstGetTransactionCount = false;
@ -88,7 +88,7 @@ describe('NonceTrackerSubprovider', () => {
provider.addProvider(createFixtureSubprovider()); provider.addProvider(createFixtureSubprovider());
provider.addProvider( provider.addProvider(
new FixtureSubprovider({ new FixtureSubprovider({
eth_sendRawTransaction: (data: any, next: any, end: any) => { eth_sendRawTransaction: (_data: any, _next: any, end: any) => {
end(new Error('Transaction nonce is too low')); end(new Error('Transaction nonce is too low'));
}, },
}), }),
@ -123,7 +123,7 @@ describe('NonceTrackerSubprovider', () => {
provider.addProvider(createFixtureSubprovider()); provider.addProvider(createFixtureSubprovider());
provider.addProvider( provider.addProvider(
new FixtureSubprovider({ new FixtureSubprovider({
eth_sendRawTransaction: (data: any, next: any, end: any) => { eth_sendRawTransaction: (_data: any, _next: any, end: any) => {
end(null); end(null);
}, },
}), }),

View File

@ -101,7 +101,7 @@ describe('PrivateKeyWalletSubprovider', () => {
params: [fixtureData.TEST_RPC_ACCOUNT_0, nonHexMessage], params: [fixtureData.TEST_RPC_ACCOUNT_0, nonHexMessage],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world');
done(); done();
@ -116,7 +116,7 @@ describe('PrivateKeyWalletSubprovider', () => {
params: [nonHexMessage, fixtureData.TEST_RPC_ACCOUNT_0], params: [nonHexMessage, fixtureData.TEST_RPC_ACCOUNT_0],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world');
done(); done();
@ -131,7 +131,7 @@ describe('PrivateKeyWalletSubprovider', () => {
params: [messageHex, fixtureData.TEST_RPC_ACCOUNT_1], params: [messageHex, fixtureData.TEST_RPC_ACCOUNT_1],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal( expect(err.message).to.be.equal(
`Requested to sign message with address: ${ `Requested to sign message with address: ${
@ -153,7 +153,7 @@ describe('PrivateKeyWalletSubprovider', () => {
params: [tx], params: [tx],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied);
done(); done();
@ -172,7 +172,7 @@ describe('PrivateKeyWalletSubprovider', () => {
params: [tx], params: [tx],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied); expect(err.message).to.be.equal(WalletSubproviderErrors.SenderInvalidOrNotSupplied);
done(); done();
@ -187,7 +187,7 @@ describe('PrivateKeyWalletSubprovider', () => {
params: [messageHex, '0x0'], params: [messageHex, '0x0'],
id: 1, id: 1,
}; };
const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { const callback = reportCallbackErrors(done)((err: Error, _response: JSONRPCResponsePayload) => {
expect(err).to.not.be.a('null'); expect(err).to.not.be.a('null');
expect(err.message).to.be.equal(`Expected address to be of type ETHAddressHex, encountered: 0x0`); expect(err.message).to.be.equal(`Expected address to be of type ETHAddressHex, encountered: 0x0`);
done(); done();

View File

@ -71,9 +71,9 @@ export class Handler {
}; };
}); });
} }
public getQueueInfo(req: express.Request, res: express.Response): void { public getQueueInfo(_req: express.Request, res: express.Response): void {
res.setHeader('Content-Type', 'application/json'); res.setHeader('Content-Type', 'application/json');
const queueInfo = _.mapValues(rpcUrls, (rpcUrl: string, networkId: string) => { const queueInfo = _.mapValues(rpcUrls, (_rpcUrl: string, networkId: string) => {
const dispatchQueue = this._networkConfigByNetworkId[networkId].dispatchQueue; const dispatchQueue = this._networkConfigByNetworkId[networkId].dispatchQueue;
return { return {
full: dispatchQueue.isFull(), full: dispatchQueue.isFull(),
@ -95,7 +95,7 @@ export class Handler {
public async dispenseZRXOrderAsync( public async dispenseZRXOrderAsync(
req: express.Request, req: express.Request,
res: express.Response, res: express.Response,
next: express.NextFunction, _next: express.NextFunction,
): Promise<void> { ): Promise<void> {
await this._dispenseOrderAsync(req, res, RequestedAssetType.ZRX); await this._dispenseOrderAsync(req, res, RequestedAssetType.ZRX);
} }
@ -171,8 +171,6 @@ export class Handler {
...order, ...order,
ecSignature: signature, ecSignature: signature,
}; };
// tslint:disable-next-line:no-unused-variable
const signedOrderHash = ZeroEx.getOrderHashHex(signedOrder);
const payload = JSON.stringify(signedOrder); const payload = JSON.stringify(signedOrder);
logUtils.log(`Dispensed signed order: ${payload}`); logUtils.log(`Dispensed signed order: ${payload}`);
res.status(constants.SUCCESS_STATUS).send(payload); res.status(constants.SUCCESS_STATUS).send(payload);

View File

@ -11,6 +11,7 @@ errorReporter.setup();
const app = express(); const app = express();
app.use(bodyParser.json()); // for parsing application/json app.use(bodyParser.json()); // for parsing application/json
// tslint:disable-next-line:no-unused-variable
app.use((req, res, next) => { app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
@ -18,6 +19,7 @@ app.use((req, res, next) => {
}); });
const handler = new Handler(); const handler = new Handler();
// tslint:disable-next-line:no-unused-variable
app.get('/ping', (req: express.Request, res: express.Response) => { app.get('/ping', (req: express.Request, res: express.Response) => {
res.status(constants.SUCCESS_STATUS).send('pong'); res.status(constants.SUCCESS_STATUS).send('pong');
}); });

View File

@ -45,7 +45,7 @@
"no-parameter-reassignment": true, "no-parameter-reassignment": true,
"no-redundant-jsdoc": true, "no-redundant-jsdoc": true,
"no-return-await": true, "no-return-await": true,
"no-unused-variable": true, "no-unused-variable": [true, "check-parameters"],
"no-string-throw": true, "no-string-throw": true,
"no-submodule-imports": false, "no-submodule-imports": false,
"no-unnecessary-type-assertion": true, "no-unnecessary-type-assertion": true,

View File

@ -132,7 +132,7 @@ export class Blockchain {
return provider; return provider;
} }
constructor(dispatcher: Dispatcher, isSalePage: boolean = false) { constructor(dispatcher: Dispatcher) {
this._dispatcher = dispatcher; this._dispatcher = dispatcher;
const defaultGasPrice = GWEI_IN_WEI * 30; const defaultGasPrice = GWEI_IN_WEI * 30;
this._defaultGasPrice = new BigNumber(defaultGasPrice); this._defaultGasPrice = new BigNumber(defaultGasPrice);
@ -577,13 +577,13 @@ export class Blockchain {
trackedTokensByAddress[token.address] = token; trackedTokensByAddress[token.address] = token;
}); });
if (!_.isUndefined(this._userAddressIfExists)) { if (!_.isUndefined(this._userAddressIfExists)) {
_.each(trackedTokensByAddress, (token: Token, address: string) => { _.each(trackedTokensByAddress, (token: Token) => {
trackedTokenStorage.addTrackedTokenToUser(this._userAddressIfExists, this.networkId, token); trackedTokenStorage.addTrackedTokenToUser(this._userAddressIfExists, this.networkId, token);
}); });
} }
} else { } else {
// Properly set all tokenRegistry tokens `isTracked` to true if they are in the existing trackedTokens array // Properly set all tokenRegistry tokens `isTracked` to true if they are in the existing trackedTokens array
_.each(trackedTokensByAddress, (trackedToken: Token, address: string) => { _.each(trackedTokensByAddress, (_trackedToken: Token, address: string) => {
if (!_.isUndefined(tokenRegistryTokensByAddress[address])) { if (!_.isUndefined(tokenRegistryTokensByAddress[address])) {
tokenRegistryTokensByAddress[address].isTracked = true; tokenRegistryTokensByAddress[address].isTracked = true;
} }
@ -754,7 +754,7 @@ export class Blockchain {
const tokenRegistryTokens = await this._contractWrappers.tokenRegistry.getTokensAsync(); const tokenRegistryTokens = await this._contractWrappers.tokenRegistry.getTokensAsync();
const tokenByAddress: TokenByAddress = {}; const tokenByAddress: TokenByAddress = {};
_.each(tokenRegistryTokens, (t: ZeroExToken, i: number) => { _.each(tokenRegistryTokens, (t: ZeroExToken) => {
// HACK: For now we have a hard-coded list of iconUrls for the dummyTokens // HACK: For now we have a hard-coded list of iconUrls for the dummyTokens
// TODO: Refactor this out and pull the iconUrl directly from the TokenRegistry // TODO: Refactor this out and pull the iconUrl directly from the TokenRegistry
const iconUrl = configs.ICON_URL_BY_SYMBOL[t.symbol]; const iconUrl = configs.ICON_URL_BY_SYMBOL[t.symbol];

View File

@ -250,7 +250,7 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
}); });
return true; return true;
} }
private _onDerivationPathChanged(e: any, derivationPath: string): void { private _onDerivationPathChanged(_event: any, derivationPath: string): void {
let derivationErrMsg = ''; let derivationErrMsg = '';
if (!_.startsWith(derivationPath, VALID_ETHEREUM_DERIVATION_PATH_PREFIX)) { if (!_.startsWith(derivationPath, VALID_ETHEREUM_DERIVATION_PATH_PREFIX)) {
derivationErrMsg = 'Must be valid Ethereum path.'; derivationErrMsg = 'Must be valid Ethereum path.';
@ -295,7 +295,7 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
} }
return userAddresses; return userAddresses;
} }
private _onSelectedNetworkUpdated(e: any, index: number, networkId: number): void { private _onSelectedNetworkUpdated(_event: any, _index: number, networkId: number): void {
this.setState({ this.setState({
preferredNetworkId: networkId, preferredNetworkId: networkId,
}); });

View File

@ -221,9 +221,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt
</TableHeaderColumn> </TableHeaderColumn>
</TableRow> </TableRow>
</TableHeader> </TableHeader>
<TableBody displayRowCheckbox={false}> <TableBody displayRowCheckbox={false}>{this._renderOutdatedWeths(etherToken)}</TableBody>
{this._renderOutdatedWeths(etherToken, this.state.ethTokenState)}
</TableBody>
</Table> </Table>
</div> </div>
</div> </div>
@ -249,7 +247,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt
</div> </div>
); );
} }
private _renderOutdatedWeths(etherToken: Token, etherTokenState: TokenState): React.ReactNode { private _renderOutdatedWeths(etherToken: Token): React.ReactNode {
const rows = _.map( const rows = _.map(
configs.OUTDATED_WRAPPED_ETHERS, configs.OUTDATED_WRAPPED_ETHERS,
(outdatedWETHByNetworkId: OutdatedWrappedEtherByNetworkId) => { (outdatedWETHByNetworkId: OutdatedWrappedEtherByNetworkId) => {

View File

@ -351,7 +351,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
this._onFillOrderClickFireAndForgetAsync(); this._onFillOrderClickFireAndForgetAsync();
} }
} }
private _onFillAmountChange(isValid: boolean, amount?: BigNumber): void { private _onFillAmountChange(_isValid: boolean, amount?: BigNumber): void {
this.props.dispatcher.updateOrderFillAmount(amount); this.props.dispatcher.updateOrderFillAmount(amount);
} }
private _onFillOrderJSONChanged(event: any): void { private _onFillOrderJSONChanged(event: any): void {

View File

@ -235,7 +235,7 @@ export class Footer extends React.Component<FooterProps, FooterState> {
</div> </div>
); );
} }
private _updateLanguage(e: any, index: number, value: Language): void { private _updateLanguage(_event: any, _index: number, value: Language): void {
this.setState({ this.setState({
selectedLanguage: value, selectedLanguage: value,
}); });

View File

@ -226,7 +226,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
</div> </div>
); );
} }
private _onTokenAmountChange(token: Token, side: Side, isValid: boolean, amount?: BigNumber): void { private _onTokenAmountChange(token: Token, side: Side, _isValid: boolean, amount?: BigNumber): void {
this.props.dispatcher.updateChosenAssetToken(side, { this.props.dispatcher.updateChosenAssetToken(side, {
address: token.address, address: token.address,
amount, amount,

View File

@ -152,7 +152,7 @@ export class NewTokenForm extends React.Component<NewTokenFormProps, NewTokenFor
}; };
this.props.onNewTokenSubmitted(newToken); this.props.onNewTokenSubmitted(newToken);
} }
private _onTokenNameChanged(e: any, name: string): void { private _onTokenNameChanged(_event: any, name: string): void {
let nameErrText = ''; let nameErrText = '';
const maxLength = 30; const maxLength = 30;
const tokens = _.values(this.props.tokenByAddress); const tokens = _.values(this.props.tokenByAddress);
@ -173,7 +173,7 @@ export class NewTokenForm extends React.Component<NewTokenFormProps, NewTokenFor
nameErrText, nameErrText,
}); });
} }
private _onTokenSymbolChanged(e: any, symbol: string): void { private _onTokenSymbolChanged(_event: any, symbol: string): void {
let symbolErrText = ''; let symbolErrText = '';
const maxLength = 5; const maxLength = 5;
const tokens = _.values(this.props.tokenByAddress); const tokens = _.values(this.props.tokenByAddress);
@ -193,7 +193,7 @@ export class NewTokenForm extends React.Component<NewTokenFormProps, NewTokenFor
symbolErrText, symbolErrText,
}); });
} }
private _onTokenDecimalsChanged(e: any, decimals: string): void { private _onTokenDecimalsChanged(_event: any, decimals: string): void {
let decimalsErrText = ''; let decimalsErrText = '';
const maxLength = 2; const maxLength = 2;
if (decimals === '') { if (decimals === '') {

View File

@ -104,7 +104,7 @@ export class BalanceBoundedInput extends React.Component<BalanceBoundedInputProp
/> />
); );
} }
private _onValueChange(e: any, amountString: string): void { private _onValueChange(_event: any, amountString: string): void {
this._setAmountState(amountString, this.props.balance, () => { this._setAmountState(amountString, this.props.balance, () => {
const isValid = _.isUndefined(this._validate(amountString, this.props.balance)); const isValid = _.isUndefined(this._validate(amountString, this.props.balance));
const isPositiveNumber = utils.isNumeric(amountString) && !_.includes(amountString, '-'); const isPositiveNumber = utils.isNumeric(amountString) && !_.includes(amountString, '-');

View File

@ -80,7 +80,7 @@ export class ExpirationInput extends React.Component<ExpirationInputProps, Expir
const defaultDateTime = utils.initialOrderExpiryUnixTimestampSec(); const defaultDateTime = utils.initialOrderExpiryUnixTimestampSec();
this.props.updateOrderExpiry(defaultDateTime); this.props.updateOrderExpiry(defaultDateTime);
} }
private _onDateChanged(e: any, date: Date): void { private _onDateChanged(_event: any, date: Date): void {
const dateMoment = moment(date); const dateMoment = moment(date);
this.setState({ this.setState({
dateMoment, dateMoment,
@ -88,7 +88,7 @@ export class ExpirationInput extends React.Component<ExpirationInputProps, Expir
const timestamp = utils.convertToUnixTimestampSeconds(dateMoment, this.state.timeMoment); const timestamp = utils.convertToUnixTimestampSeconds(dateMoment, this.state.timeMoment);
this.props.updateOrderExpiry(timestamp); this.props.updateOrderExpiry(timestamp);
} }
private _onTimeChanged(e: any, time: Date): void { private _onTimeChanged(_event: any, time: Date): void {
const timeMoment = moment(time); const timeMoment = moment(time);
this.setState({ this.setState({
timeMoment, timeMoment,

View File

@ -310,7 +310,7 @@ export class LegacyPortal extends React.Component<LegacyPortalProps, LegacyPorta
/> />
); );
} }
private _renderFillOrder(match: any, location: Location, history: History): React.ReactNode { private _renderFillOrder(_match: any, _location: Location, _history: History): React.ReactNode {
const initialFillOrder = !_.isUndefined(this.props.userSuppliedOrderCache) const initialFillOrder = !_.isUndefined(this.props.userSuppliedOrderCache)
? this.props.userSuppliedOrderCache ? this.props.userSuppliedOrderCache
: this._sharedOrderIfExists; : this._sharedOrderIfExists;
@ -329,7 +329,7 @@ export class LegacyPortal extends React.Component<LegacyPortalProps, LegacyPorta
/> />
); );
} }
private _renderGenerateOrderForm(match: any, location: Location, history: History): React.ReactNode { private _renderGenerateOrderForm(_match: any, _location: Location, _history: History): React.ReactNode {
return ( return (
<GenerateOrderForm <GenerateOrderForm
blockchain={this._blockchain} blockchain={this._blockchain}

View File

@ -634,7 +634,7 @@ export class Portal extends React.Component<PortalProps, PortalState> {
const tokenSymbols = _.keys(tokenAddressBySymbol); const tokenSymbols = _.keys(tokenAddressBySymbol);
try { try {
const priceBySymbol = await backendClient.getPriceInfoAsync(tokenSymbols); const priceBySymbol = await backendClient.getPriceInfoAsync(tokenSymbols);
const priceByAddress = _.mapKeys(priceBySymbol, (value, symbol) => _.get(tokenAddressBySymbol, symbol)); const priceByAddress = _.mapKeys(priceBySymbol, (_value, symbol) => _.get(tokenAddressBySymbol, symbol));
const result = _.mapValues(priceByAddress, price => { const result = _.mapValues(priceByAddress, price => {
const priceBigNumber = new BigNumber(price); const priceBigNumber = new BigNumber(price);
return priceBigNumber; return priceBigNumber;

View File

@ -4,6 +4,6 @@ interface RedirecterProps {
location: string; location: string;
} }
export function Redirecter(props: RedirecterProps): void { export function Redirecter(_props: RedirecterProps): void {
window.location.href = constants.URL_ANGELLIST; window.location.href = constants.URL_ANGELLIST;
} }

View File

@ -581,7 +581,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
} }
return true; return true;
} }
private _onErrorDialogToggle(isOpen: boolean): void { private _onErrorDialogToggle(_isOpen: boolean): void {
this.setState({ this.setState({
errorType: undefined, errorType: undefined,
}); });

View File

@ -42,7 +42,7 @@ export class DropDown extends React.Component<DropDownProps, DropDownState> {
public componentWillUnmount(): void { public componentWillUnmount(): void {
window.clearInterval(this._popoverCloseCheckIntervalId); window.clearInterval(this._popoverCloseCheckIntervalId);
} }
public componentWillReceiveProps(nextProps: DropDownProps): void { public componentWillReceiveProps(_nextProps: DropDownProps): void {
// HACK: If the popoverContent is updated to a different dimension and the users // HACK: If the popoverContent is updated to a different dimension and the users
// mouse is no longer above it, the dropdown can enter an inconsistent state where // mouse is no longer above it, the dropdown can enter an inconsistent state where
// it believes the user is still hovering over it. In order to remedy this, we // it believes the user is still hovering over it. In order to remedy this, we

View File

@ -222,7 +222,7 @@ export class Wallet extends React.Component<WalletProps, WalletState> {
</div> </div>
); );
} }
private _onSidebarHover(event: React.FormEvent<HTMLInputElement>): void { private _onSidebarHover(_event: React.FormEvent<HTMLInputElement>): void {
this.setState({ this.setState({
isHoveringSidebar: true, isHoveringSidebar: true,
}); });
@ -314,7 +314,7 @@ export class Wallet extends React.Component<WalletProps, WalletState> {
); );
return _.map(trackedTokensStartingWithEtherToken, this._renderTokenRow.bind(this)); return _.map(trackedTokensStartingWithEtherToken, this._renderTokenRow.bind(this));
} }
private _renderTokenRow(token: Token, index: number): React.ReactNode { private _renderTokenRow(token: Token, _index: number): React.ReactNode {
const tokenState = this.props.trackedTokenStateByAddress[token.address]; const tokenState = this.props.trackedTokenStateByAddress[token.address];
const tokenLink = sharedUtils.getEtherScanLinkIfExists( const tokenLink = sharedUtils.getEtherScanLinkIfExists(
token.address, token.address,

View File

@ -145,7 +145,7 @@ export class WrapEtherItem extends React.Component<WrapEtherItemProps, WrapEther
</div> </div>
); );
} }
private _onValueChange(isValid: boolean, amount?: BigNumber): void { private _onValueChange(_isValid: boolean, amount?: BigNumber): void {
this.setState({ this.setState({
currentInputAmount: amount, currentInputAmount: amount,
}); });

View File

@ -14,7 +14,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: AboutProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: AboutProps): ConnectedState => ({
translate: state.translate, translate: state.translate,
}); });

View File

@ -89,7 +89,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -106,7 +106,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -14,7 +14,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: FAQProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: FAQProps): ConnectedState => ({
translate: state.translate, translate: state.translate,
}); });

View File

@ -30,7 +30,7 @@ interface ConnectedState {
lastForceTokenStateRefetch: number; lastForceTokenStateRefetch: number;
} }
const mapStateToProps = (state: State, ownProps: GenerateOrderFormProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: GenerateOrderFormProps): ConnectedState => ({
blockchainErr: state.blockchainErr, blockchainErr: state.blockchainErr,
blockchainIsLoaded: state.blockchainIsLoaded, blockchainIsLoaded: state.blockchainIsLoaded,
orderExpiryTimestamp: state.orderExpiryTimestamp, orderExpiryTimestamp: state.orderExpiryTimestamp,

View File

@ -70,7 +70,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -14,7 +14,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: LandingProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: LandingProps): ConnectedState => ({
translate: state.translate, translate: state.translate,
}); });

View File

@ -37,7 +37,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: LegacyPortalComponentProps): ConnectedState => { const mapStateToProps = (state: State, _ownProps: LegacyPortalComponentProps): ConnectedState => {
const receiveAssetToken = state.sideToAssetToken[Side.Receive]; const receiveAssetToken = state.sideToAssetToken[Side.Receive];
const depositAssetToken = state.sideToAssetToken[Side.Deposit]; const depositAssetToken = state.sideToAssetToken[Side.Deposit];
const receiveAddress = !_.isUndefined(receiveAssetToken.address) const receiveAddress = !_.isUndefined(receiveAssetToken.address)

View File

@ -14,7 +14,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: NotFoundProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: NotFoundProps): ConnectedState => ({
translate: state.translate, translate: state.translate,
}); });

View File

@ -81,7 +81,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -34,7 +34,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: PortalComponentProps): ConnectedState => { const mapStateToProps = (state: State, _ownProps: PortalComponentProps): ConnectedState => {
const receiveAssetToken = state.sideToAssetToken[Side.Receive]; const receiveAssetToken = state.sideToAssetToken[Side.Receive];
const depositAssetToken = state.sideToAssetToken[Side.Deposit]; const depositAssetToken = state.sideToAssetToken[Side.Deposit];
const receiveAddress = !_.isUndefined(receiveAssetToken.address) const receiveAddress = !_.isUndefined(receiveAssetToken.address)

View File

@ -28,7 +28,7 @@ interface ConnectedDispatch {
updateOnboardingStep: (stepIndex: number) => void; updateOnboardingStep: (stepIndex: number) => void;
} }
const mapStateToProps = (state: State, ownProps: PortalOnboardingFlowProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: PortalOnboardingFlowProps): ConnectedState => ({
stepIndex: state.portalOnboardingStep, stepIndex: state.portalOnboardingStep,
isRunning: state.isPortalOnboardingShowing, isRunning: state.isPortalOnboardingShowing,
userAddress: state.userAddress, userAddress: state.userAddress,

View File

@ -75,7 +75,7 @@ interface ConnectedDispatch {
docsInfo: DocsInfo; docsInfo: DocsInfo;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -67,7 +67,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -96,7 +96,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -128,7 +128,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -105,7 +105,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
translate: state.translate, translate: state.translate,

View File

@ -14,7 +14,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: WikiProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: WikiProps): ConnectedState => ({
translate: state.translate, translate: state.translate,
}); });

View File

@ -209,7 +209,7 @@ interface ConnectedDispatch {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
docsVersion: state.docsVersion, docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions, availableDocVersions: state.availableDocVersions,
docsInfo, docsInfo,

View File

@ -57,7 +57,7 @@ export const tradeHistoryStorage = {
return {}; return {};
} }
const userFillsByHash = JSON.parse(userFillsJSONString); const userFillsByHash = JSON.parse(userFillsJSONString);
_.each(userFillsByHash, (fill, hash) => { _.each(userFillsByHash, fill => {
fill.paidMakerFee = new BigNumber(fill.paidMakerFee); fill.paidMakerFee = new BigNumber(fill.paidMakerFee);
fill.paidTakerFee = new BigNumber(fill.paidTakerFee); fill.paidTakerFee = new BigNumber(fill.paidTakerFee);
fill.filledTakerTokenAmount = new BigNumber(fill.filledTakerTokenAmount); fill.filledTakerTokenAmount = new BigNumber(fill.filledTakerTokenAmount);

View File

@ -11,7 +11,7 @@ export interface NotFoundProps {
dispatcher: Dispatcher; dispatcher: Dispatcher;
} }
export const NotFound = (props: NotFoundProps) => { export const NotFound = (_props: NotFoundProps) => {
return ( return (
<div> <div>
<TopBar blockchainIsLoaded={false} location={this.props.location} translate={this.props.translate} /> <TopBar blockchainIsLoaded={false} location={this.props.location} translate={this.props.translate} />

View File

@ -233,7 +233,7 @@ export class Wiki extends React.Component<WikiProps, WikiState> {
} }
return menuSubsectionsBySection; return menuSubsectionsBySection;
} }
private _onSidebarHover(event: React.FormEvent<HTMLInputElement>): void { private _onSidebarHover(_event: React.FormEvent<HTMLInputElement>): void {
this.setState({ this.setState({
isHoveringSidebar: true, isHoveringSidebar: true,
}); });
@ -243,7 +243,7 @@ export class Wiki extends React.Component<WikiProps, WikiState> {
isHoveringSidebar: false, isHoveringSidebar: false,
}); });
} }
private _onHashChanged(event: any): void { private _onHashChanged(_event: any): void {
const hash = window.location.hash.slice(1); const hash = window.location.hash.slice(1);
sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID); sharedUtils.scrollToHash(hash, sharedConstants.SCROLL_CONTAINER_ID);
} }

View File

@ -37,7 +37,7 @@ export const errorReporter = {
return; // Let's not log development errors to rollbar return; // Let's not log development errors to rollbar
} }
return new Promise((resolve, reject) => { return new Promise((resolve, _reject) => {
rollbar.error(err, (rollbarErr: Error) => { rollbar.error(err, (rollbarErr: Error) => {
if (rollbarErr) { if (rollbarErr) {
logUtils.log(`Error reporting to rollbar, ignoring: ${rollbarErr}`); logUtils.log(`Error reporting to rollbar, ignoring: ${rollbarErr}`);

View File

@ -152,7 +152,7 @@ export const utils = {
const intervalId = setTimeout(() => { const intervalId = setTimeout(() => {
resolve(false); resolve(false);
}, getApiVersionTimeoutMs); }, getApiVersionTimeoutMs);
u2f.getApiVersion((version: number) => { u2f.getApiVersion((_version: number) => {
clearTimeout(intervalId); clearTimeout(intervalId);
resolve(true); resolve(true);
}); });
@ -279,7 +279,7 @@ export const utils = {
if (document.readyState === 'complete') { if (document.readyState === 'complete') {
return; // Already loaded return; // Already loaded
} }
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, _reject) => {
window.onload = () => resolve(); window.onload = () => resolve();
}); });
}, },