Auto-fix linter errors in other mono-repo packages
This commit is contained in:
parent
74633126ce
commit
7b8d9193e2
@ -1,11 +1,11 @@
|
|||||||
|
import {
|
||||||
|
Schema,
|
||||||
|
SchemaValidator,
|
||||||
|
} from '@0xproject/json-schemas';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import * as ethereum_address from 'ethereum-address';
|
import * as ethereum_address from 'ethereum-address';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import * as validUrl from 'valid-url';
|
import * as validUrl from 'valid-url';
|
||||||
import {
|
|
||||||
SchemaValidator,
|
|
||||||
Schema,
|
|
||||||
} from '@0xproject/json-schemas';
|
|
||||||
|
|
||||||
const HEX_REGEX = /^0x[0-9A-F]*$/i;
|
const HEX_REGEX = /^0x[0-9A-F]*$/i;
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ export const assert = {
|
|||||||
this.assert(_.isBoolean(value), this.typeAssertionMessage(variableName, 'boolean', value));
|
this.assert(_.isBoolean(value), this.typeAssertionMessage(variableName, 'boolean', value));
|
||||||
},
|
},
|
||||||
isWeb3Provider(variableName: string, value: any): void {
|
isWeb3Provider(variableName: string, value: any): void {
|
||||||
const isWeb3Provider = _.isFunction((value as any).send) || _.isFunction((value as any).sendAsync);
|
const isWeb3Provider = _.isFunction((value).send) || _.isFunction((value).sendAsync);
|
||||||
this.assert(isWeb3Provider, this.typeAssertionMessage(variableName, 'Web3.Provider', value));
|
this.assert(isWeb3Provider, this.typeAssertionMessage(variableName, 'Web3.Provider', value));
|
||||||
},
|
},
|
||||||
doesConformToSchema(variableName: string, value: any, schema: Schema): void {
|
doesConformToSchema(variableName: string, value: any, schema: Schema): void {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import 'mocha';
|
|
||||||
import * as dirtyChai from 'dirty-chai';
|
|
||||||
import * as chai from 'chai';
|
|
||||||
import {BigNumber} from 'bignumber.js';
|
|
||||||
import {schemas} from '@0xproject/json-schemas';
|
import {schemas} from '@0xproject/json-schemas';
|
||||||
|
import {BigNumber} from 'bignumber.js';
|
||||||
|
import * as chai from 'chai';
|
||||||
|
import * as dirtyChai from 'dirty-chai';
|
||||||
|
import 'mocha';
|
||||||
|
|
||||||
import {assert} from '../src/index';
|
import {assert} from '../src/index';
|
||||||
|
|
||||||
chai.config.includeStack = true;
|
chai.config.includeStack = true;
|
||||||
@ -183,7 +184,7 @@ describe('Assertions', () => {
|
|||||||
it('should not throw for valid input', () => {
|
it('should not throw for valid input', () => {
|
||||||
const validInputs = [
|
const validInputs = [
|
||||||
42,
|
42,
|
||||||
0.00,
|
0.00, // tslint:disable-line:number-literal-format
|
||||||
21e+42,
|
21e+42,
|
||||||
];
|
];
|
||||||
validInputs.forEach(input => expect(assert.isNumber.bind(assert, variableName, input)).to.not.throw());
|
validInputs.forEach(input => expect(assert.isNumber.bind(assert, variableName, input)).to.not.throw());
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
|
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
|
||||||
"upload_docs_json": "aws s3 cp docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json",
|
"upload_docs_json": "aws s3 cp docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json",
|
||||||
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
|
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
|
||||||
"lint": "tslint 'src/**/*.ts' 'test/**/*.ts'",
|
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
|
||||||
"run_mocha": "mocha lib/test/**/*_test.js",
|
"run_mocha": "mocha lib/test/**/*_test.js",
|
||||||
"test": "run-s clean build copy_test_fixtures run_mocha",
|
"test": "run-s clean build copy_test_fixtures run_mocha",
|
||||||
"test:circleci": "yarn test"
|
"test:circleci": "yarn test"
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import 'isomorphic-fetch';
|
import {SignedOrder} from '0x.js';
|
||||||
import * as _ from 'lodash';
|
|
||||||
import {BigNumber} from 'bignumber.js';
|
|
||||||
import * as queryString from 'query-string';
|
|
||||||
import {assert} from '@0xproject/assert';
|
import {assert} from '@0xproject/assert';
|
||||||
import {schemas} from '@0xproject/json-schemas';
|
import {schemas} from '@0xproject/json-schemas';
|
||||||
import {SignedOrder} from '0x.js';
|
import {BigNumber} from 'bignumber.js';
|
||||||
|
import 'isomorphic-fetch';
|
||||||
|
import * as _ from 'lodash';
|
||||||
|
import * as queryString from 'query-string';
|
||||||
|
|
||||||
|
import {schemas as clientSchemas} from './schemas/schemas';
|
||||||
import {
|
import {
|
||||||
Client,
|
Client,
|
||||||
FeesRequest,
|
FeesRequest,
|
||||||
@ -15,7 +17,6 @@ import {
|
|||||||
TokenPairsItem,
|
TokenPairsItem,
|
||||||
TokenPairsRequest,
|
TokenPairsRequest,
|
||||||
} from './types';
|
} from './types';
|
||||||
import {schemas as clientSchemas} from './schemas/schemas';
|
|
||||||
import {typeConverters} from './utils/type_converters';
|
import {typeConverters} from './utils/type_converters';
|
||||||
|
|
||||||
// TODO: move this and bigNumberConfigs in the 0x.js package into one place
|
// TODO: move this and bigNumberConfigs in the 0x.js package into one place
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import * as _ from 'lodash';
|
|
||||||
import {SignedOrder} from '0x.js';
|
import {SignedOrder} from '0x.js';
|
||||||
import {assert} from '@0xproject/assert';
|
import {assert} from '@0xproject/assert';
|
||||||
import {schemas} from '@0xproject/json-schemas';
|
import {schemas} from '@0xproject/json-schemas';
|
||||||
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
OrderbookChannelMessage,
|
OrderbookChannelMessage,
|
||||||
OrderbookChannelMessageTypes,
|
OrderbookChannelMessageTypes,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
|
|
||||||
import {typeConverters} from './type_converters';
|
import {typeConverters} from './type_converters';
|
||||||
|
|
||||||
export const orderbookChannelMessageParsers = {
|
export const orderbookChannelMessageParsers = {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as _ from 'lodash';
|
|
||||||
import {BigNumber} from 'bignumber.js';
|
import {BigNumber} from 'bignumber.js';
|
||||||
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
// TODO: convert all of these to non-mutating, pure functions
|
// TODO: convert all of these to non-mutating, pure functions
|
||||||
export const typeConverters = {
|
export const typeConverters = {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import * as _ from 'lodash';
|
import {SignedOrder} from '0x.js';
|
||||||
import * as WebSocket from 'websocket';
|
|
||||||
import {assert} from '@0xproject/assert';
|
import {assert} from '@0xproject/assert';
|
||||||
import {schemas} from '@0xproject/json-schemas';
|
import {schemas} from '@0xproject/json-schemas';
|
||||||
import {SignedOrder} from '0x.js';
|
import * as _ from 'lodash';
|
||||||
|
import * as WebSocket from 'websocket';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
OrderbookChannel,
|
OrderbookChannel,
|
||||||
OrderbookChannelHandler,
|
OrderbookChannelHandler,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {BigNumber} from 'bignumber.js';
|
import {BigNumber} from 'bignumber.js';
|
||||||
|
|
||||||
import {FeesResponse} from '../../../src/types';
|
import {FeesResponse} from '../../../src/types';
|
||||||
|
|
||||||
export const feesResponse: FeesResponse = {
|
export const feesResponse: FeesResponse = {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {BigNumber} from 'bignumber.js';
|
import {BigNumber} from 'bignumber.js';
|
||||||
|
|
||||||
import {TokenPairsItem} from '../../../src/types';
|
import {TokenPairsItem} from '../../../src/types';
|
||||||
|
|
||||||
export const tokenPairsResponse: TokenPairsItem[] = [
|
export const tokenPairsResponse: TokenPairsItem[] = [
|
||||||
|
@ -1,23 +1,25 @@
|
|||||||
import 'mocha';
|
import {BigNumber} from 'bignumber.js';
|
||||||
import * as dirtyChai from 'dirty-chai';
|
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
import * as chaiAsPromised from 'chai-as-promised';
|
import * as chaiAsPromised from 'chai-as-promised';
|
||||||
|
import * as dirtyChai from 'dirty-chai';
|
||||||
import * as fetchMock from 'fetch-mock';
|
import * as fetchMock from 'fetch-mock';
|
||||||
import {BigNumber} from 'bignumber.js';
|
import 'mocha';
|
||||||
|
|
||||||
import {HttpClient} from '../src/index';
|
import {HttpClient} from '../src/index';
|
||||||
|
|
||||||
import {feesResponse} from './fixtures/standard_relayer_api/fees';
|
import {feesResponse} from './fixtures/standard_relayer_api/fees';
|
||||||
|
import * as feesResponseJSON from './fixtures/standard_relayer_api/fees.json';
|
||||||
import {
|
import {
|
||||||
orderResponse,
|
orderResponse,
|
||||||
} from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f';
|
} from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f';
|
||||||
import {ordersResponse} from './fixtures/standard_relayer_api/orders';
|
|
||||||
import {tokenPairsResponse} from './fixtures/standard_relayer_api/token_pairs';
|
|
||||||
import {orderbookResponse} from './fixtures/standard_relayer_api/orderbook';
|
|
||||||
import * as feesResponseJSON from './fixtures/standard_relayer_api/fees.json';
|
|
||||||
// tslint:disable-next-line:max-line-length
|
// tslint:disable-next-line:max-line-length
|
||||||
import * as orderResponseJSON from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json';
|
import * as orderResponseJSON from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f.json';
|
||||||
import * as ordersResponseJSON from './fixtures/standard_relayer_api/orders.json';
|
import {orderbookResponse} from './fixtures/standard_relayer_api/orderbook';
|
||||||
import * as tokenPairsResponseJSON from './fixtures/standard_relayer_api/token_pairs.json';
|
|
||||||
import * as orderbookJSON from './fixtures/standard_relayer_api/orderbook.json';
|
import * as orderbookJSON from './fixtures/standard_relayer_api/orderbook.json';
|
||||||
|
import {ordersResponse} from './fixtures/standard_relayer_api/orders';
|
||||||
|
import * as ordersResponseJSON from './fixtures/standard_relayer_api/orders.json';
|
||||||
|
import {tokenPairsResponse} from './fixtures/standard_relayer_api/token_pairs';
|
||||||
|
import * as tokenPairsResponseJSON from './fixtures/standard_relayer_api/token_pairs.json';
|
||||||
|
|
||||||
chai.config.includeStack = true;
|
chai.config.includeStack = true;
|
||||||
chai.use(dirtyChai);
|
chai.use(dirtyChai);
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
import 'mocha';
|
|
||||||
import * as dirtyChai from 'dirty-chai';
|
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
|
import * as dirtyChai from 'dirty-chai';
|
||||||
|
import 'mocha';
|
||||||
|
|
||||||
import {orderbookChannelMessageParsers} from '../src/utils/orderbook_channel_message_parsers';
|
import {orderbookChannelMessageParsers} from '../src/utils/orderbook_channel_message_parsers';
|
||||||
import {
|
|
||||||
snapshotOrderbookChannelMessage,
|
|
||||||
malformedSnapshotOrderbookChannelMessage,
|
|
||||||
} from './fixtures/standard_relayer_api/snapshot_orderbook_channel_message';
|
|
||||||
import {
|
|
||||||
updateOrderbookChannelMessage,
|
|
||||||
malformedUpdateOrderbookChannelMessage,
|
|
||||||
} from './fixtures/standard_relayer_api/update_orderbook_channel_message';
|
|
||||||
import {unknownOrderbookChannelMessage} from './fixtures/standard_relayer_api/unknown_orderbook_channel_message';
|
|
||||||
import {orderbookResponse} from './fixtures/standard_relayer_api/orderbook';
|
|
||||||
// tslint:disable-next-line:max-line-length
|
// tslint:disable-next-line:max-line-length
|
||||||
import {orderResponse} from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f';
|
import {orderResponse} from './fixtures/standard_relayer_api/order/0xabc67323774bdbd24d94f977fa9ac94a50f016026fd13f42990861238897721f';
|
||||||
|
import {orderbookResponse} from './fixtures/standard_relayer_api/orderbook';
|
||||||
|
import {
|
||||||
|
malformedSnapshotOrderbookChannelMessage,
|
||||||
|
snapshotOrderbookChannelMessage,
|
||||||
|
} from './fixtures/standard_relayer_api/snapshot_orderbook_channel_message';
|
||||||
|
import {unknownOrderbookChannelMessage} from './fixtures/standard_relayer_api/unknown_orderbook_channel_message';
|
||||||
|
import {
|
||||||
|
malformedUpdateOrderbookChannelMessage,
|
||||||
|
updateOrderbookChannelMessage,
|
||||||
|
} from './fixtures/standard_relayer_api/update_orderbook_channel_message';
|
||||||
|
|
||||||
chai.config.includeStack = true;
|
chai.config.includeStack = true;
|
||||||
chai.use(dirtyChai);
|
chai.use(dirtyChai);
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import 'mocha';
|
|
||||||
import * as _ from 'lodash';
|
|
||||||
import * as dirtyChai from 'dirty-chai';
|
|
||||||
import * as chai from 'chai';
|
import * as chai from 'chai';
|
||||||
|
import * as dirtyChai from 'dirty-chai';
|
||||||
|
import * as _ from 'lodash';
|
||||||
|
import 'mocha';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
WebSocketOrderbookChannel,
|
WebSocketOrderbookChannel,
|
||||||
} from '../src/ws_orderbook_channel';
|
} from '../src/ws_orderbook_channel';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user