Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bennycode committed Oct 26, 2023
1 parent 67a2af0 commit b853f86
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"rules": {
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-this-alias": "error",
Expand Down
10 changes: 5 additions & 5 deletions src/account/AccountAPI.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import getAccount from '../test/fixtures/rest/accounts/322dfa88-e10d-4678-856d-2930eac3e62d/GET-200.json' assert { type: "json" };
import getAccountHistory from '../test/fixtures/rest/accounts/322dfa88-e10d-4678-856d-2930eac3e62d/ledger/GET-200.json' assert { type: "json" };
import getHolds from '../test/fixtures/rest/accounts/322dfa88-e10d-4678-856d-2930eac3e62d/holds/GET-200.json' assert { type: "json" };
import genAddress from '../test/fixtures/rest/accounts/322dfa88-e10d-4678-856d-2930eac3e62d/addresses/POST-200.json' assert { type: "json" };
import listAccounts from '../test/fixtures/rest/accounts/GET-200.json' assert { type: "json" };
import getAccount from '../test/fixtures/rest/accounts/322dfa88-e10d-4678-856d-2930eac3e62d/GET-200.json' assert {type: 'json'};
import getAccountHistory from '../test/fixtures/rest/accounts/322dfa88-e10d-4678-856d-2930eac3e62d/ledger/GET-200.json' assert {type: 'json'};
import getHolds from '../test/fixtures/rest/accounts/322dfa88-e10d-4678-856d-2930eac3e62d/holds/GET-200.json' assert {type: 'json'};
import genAddress from '../test/fixtures/rest/accounts/322dfa88-e10d-4678-856d-2930eac3e62d/addresses/POST-200.json' assert {type: 'json'};
import listAccounts from '../test/fixtures/rest/accounts/GET-200.json' assert {type: 'json'};
import nock from 'nock';
import {AccountAPI, AccountType} from './AccountAPI.js';

Expand Down
2 changes: 1 addition & 1 deletion src/client/RESTClient.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {AxiosRequestConfig} from 'axios';
import nock from 'nock';
import {AccountAPI} from '../account/index.js';
import listAccounts from '../test/fixtures/rest/accounts/GET-200.json' assert { type: "json" };
import listAccounts from '../test/fixtures/rest/accounts/GET-200.json' assert {type: 'json'};
import {RESTClient} from './RESTClient.js';

describe('RESTClient', () => {
Expand Down
36 changes: 18 additions & 18 deletions src/client/RESTClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ import axios, {
AxiosInstance,
AxiosInterceptorManager,
AxiosRequestConfig,
AxiosResponse
AxiosResponse,
} from 'axios';
import axiosRetry, { isNetworkOrIdempotentRequestError } from 'axios-retry';
import { EventEmitter } from 'node:events';
import util, { DebugLogger } from 'node:util';
import axiosRetry, {isNetworkOrIdempotentRequestError} from 'axios-retry';
import {EventEmitter} from 'node:events';
import util, {DebugLogger} from 'node:util';
import querystring from 'querystring';
import { AccountAPI } from '../account/index.js';
import { RequestSetup, SignedRequest } from '../auth/RequestSigner.js';
import { CurrencyAPI } from '../currency/index.js';
import { getErrorMessage, gotRateLimited, inAirPlaneMode } from '../error/ErrorUtil.js';
import { ExchangeRateAPI } from '../exchange-rate/ExchangeRateAPI.js';
import { FeeAPI } from '../fee/index.js';
import { FillAPI } from '../fill/index.js';
import { OrderAPI } from '../order/index.js';
import { Candle, CandleGranularity, ProductAPI, ProductEvent } from '../product/index.js';
import { ProfileAPI } from '../profile/index.js';
import { TimeAPI } from '../time/index.js';
import { TransferAPI } from '../transfer/index.js';
import { UserAPI } from '../user/index.js';
import { WithdrawAPI } from '../withdraw/index.js';
import {AccountAPI} from '../account/index.js';
import {RequestSetup, SignedRequest} from '../auth/RequestSigner.js';
import {CurrencyAPI} from '../currency/index.js';
import {getErrorMessage, gotRateLimited, inAirPlaneMode} from '../error/ErrorUtil.js';
import {ExchangeRateAPI} from '../exchange-rate/ExchangeRateAPI.js';
import {FeeAPI} from '../fee/index.js';
import {FillAPI} from '../fill/index.js';
import {OrderAPI} from '../order/index.js';
import {Candle, CandleGranularity, ProductAPI, ProductEvent} from '../product/index.js';
import {ProfileAPI} from '../profile/index.js';
import {TimeAPI} from '../time/index.js';
import {TransferAPI} from '../transfer/index.js';
import {UserAPI} from '../user/index.js';
import {WithdrawAPI} from '../withdraw/index.js';

export interface RESTClient {
on(
Expand Down
22 changes: 11 additions & 11 deletions src/client/WebSocketClient.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import WebSocket = require('ws');
import tickerBTCUSD from '../test/fixtures/ws/ticker/BTC-USD.json' assert { type: "json" };
import statusPayload from '../test/fixtures/ws/status/status.json' assert { type: "json" };
import matchesBTCUSD from '../test/fixtures/ws/matches/BTC-USD.json' assert { type: "json" };
import l2snapshotBTCUSD from '../test/fixtures/ws/level2/snapshot.json' assert { type: "json" };
import l2updateBTCUSD from '../test/fixtures/ws/level2/l2update.json' assert { type: "json" };
import fullReceivedLimitBTCUSD from '../test/fixtures/ws/full/received-limit.json' assert { type: "json" };
import fullActivateBTCUSD from '../test/fixtures/ws/full/activate.json' assert { type: "json" };
import fullOpenBTCUSD from '../test/fixtures/ws/full/open.json' assert { type: "json" };
import fullDoneBTCUSD from '../test/fixtures/ws/full/done.json' assert { type: "json" };
import fullChangeBTCUSD from '../test/fixtures/ws/full/change.json' assert { type: "json" };
import emptySubscriptions from '../test/fixtures/ws/empty-subscriptions.json' assert { type: "json" };
import tickerBTCUSD from '../test/fixtures/ws/ticker/BTC-USD.json' assert {type: 'json'};
import statusPayload from '../test/fixtures/ws/status/status.json' assert {type: 'json'};
import matchesBTCUSD from '../test/fixtures/ws/matches/BTC-USD.json' assert {type: 'json'};
import l2snapshotBTCUSD from '../test/fixtures/ws/level2/snapshot.json' assert {type: 'json'};
import l2updateBTCUSD from '../test/fixtures/ws/level2/l2update.json' assert {type: 'json'};
import fullReceivedLimitBTCUSD from '../test/fixtures/ws/full/received-limit.json' assert {type: 'json'};
import fullActivateBTCUSD from '../test/fixtures/ws/full/activate.json' assert {type: 'json'};
import fullOpenBTCUSD from '../test/fixtures/ws/full/open.json' assert {type: 'json'};
import fullDoneBTCUSD from '../test/fixtures/ws/full/done.json' assert {type: 'json'};
import fullChangeBTCUSD from '../test/fixtures/ws/full/change.json' assert {type: 'json'};
import emptySubscriptions from '../test/fixtures/ws/empty-subscriptions.json' assert {type: 'json'};
import {
WebSocketChannelName,
WebSocketClient,
Expand Down
4 changes: 2 additions & 2 deletions src/exchange-rate/ExchangeRateAPI.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nock from 'nock';
import getExchangeRates from '../test/fixtures/rest/v2/exchange-rates/GET-200.json' assert { type: "json" };
import getExchangeRatesEUR from '../test/fixtures/rest/v2/exchange-rates/GET-200-EUR.json' assert { type: "json" };
import getExchangeRates from '../test/fixtures/rest/v2/exchange-rates/GET-200.json' assert {type: 'json'};
import getExchangeRatesEUR from '../test/fixtures/rest/v2/exchange-rates/GET-200-EUR.json' assert {type: 'json'};
import {ExchangeRateAPI} from './ExchangeRateAPI.js';

describe('ExchangeRateAPI', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/fill/FillAPI.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import nock from 'nock';
import BTCEUR from '../test/fixtures/rest/fills/product_id/BTC-EUR/GET-200.json' assert { type: "json" };
import BTCEUR from '../test/fixtures/rest/fills/product_id/BTC-EUR/GET-200.json' assert {type: 'json'};
import {FillAPI} from './FillAPI.js';
import querystring from 'querystring';

Expand Down
2 changes: 1 addition & 1 deletion src/product/CandleBucketUtil.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {CandleBucketUtil, CandleGranularity} from './index.js';
import oneWeekInMinutes from '../test/fixtures/rest/products/BTC-USD/candles/BTC-USD-1581292800000-60.json' assert { type: "json" };
import oneWeekInMinutes from '../test/fixtures/rest/products/BTC-USD/candles/BTC-USD-1581292800000-60.json' assert {type: 'json'};

describe('CandleBucketUtil', () => {
beforeAll(() => {
Expand Down
16 changes: 8 additions & 8 deletions src/product/ProductAPI.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import nock from 'nock';
import {Candle, CandleGranularity, OrderBookLevel, ProductAPI, ProductEvent} from './index.js';
import Level1OrderBookBTCEUR from '../test/fixtures/rest/products/BTC-EUR/book/level-1.json' assert { type: "json" };
import Level2OrderBookBTCEUR from '../test/fixtures/rest/products/BTC-EUR/book/level-2.json' assert { type: "json" };
import Level2OrderBookBTCUSD from '../test/fixtures/rest/products/BTC-USD/book/level-2.json' assert { type: "json" };
import Level3OrderBookBTCUSD from '../test/fixtures/rest/products/BTC-USD/book/level-3.json' assert { type: "json" };
import TradesBTCEUR from '../test/fixtures/rest/products/BTC-EUR/trades/GET-200.json' assert { type: "json" };
import CandlesBTCUSD from '../test/fixtures/rest/products/BTC-USD/candles/GET-200.json' assert { type: "json" };
import FirstCandleBatch from '../test/fixtures/rest/products/BTC-USD/candles/2020-03-20-00-00.json' assert { type: "json" };
import SecondCandleBatch from '../test/fixtures/rest/products/BTC-USD/candles/2020-03-20-05-00.json' assert { type: "json" };
import Level1OrderBookBTCEUR from '../test/fixtures/rest/products/BTC-EUR/book/level-1.json' assert {type: 'json'};
import Level2OrderBookBTCEUR from '../test/fixtures/rest/products/BTC-EUR/book/level-2.json' assert {type: 'json'};
import Level2OrderBookBTCUSD from '../test/fixtures/rest/products/BTC-USD/book/level-2.json' assert {type: 'json'};
import Level3OrderBookBTCUSD from '../test/fixtures/rest/products/BTC-USD/book/level-3.json' assert {type: 'json'};
import TradesBTCEUR from '../test/fixtures/rest/products/BTC-EUR/trades/GET-200.json' assert {type: 'json'};
import CandlesBTCUSD from '../test/fixtures/rest/products/BTC-USD/candles/GET-200.json' assert {type: 'json'};
import FirstCandleBatch from '../test/fixtures/rest/products/BTC-USD/candles/2020-03-20-00-00.json' assert {type: 'json'};
import SecondCandleBatch from '../test/fixtures/rest/products/BTC-USD/candles/2020-03-20-05-00.json' assert {type: 'json'};

describe('ProductAPI', () => {
afterEach(() => nock.cleanAll());
Expand Down
2 changes: 2 additions & 0 deletions src/test/helpers/SetupCoinbasePro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import {TimeAPI} from '../../time/TimeAPI.js';

declare global {
namespace globalThis {
/* eslint-disable no-var */
var client: CoinbasePro;
var REST_URL: string;
/* eslint-enable no-var */
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/user/UserAPI.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nock from 'nock';
import verifyPayload from '../test/fixtures/rest/users/self/verify/GET-200.json' assert { type: "json" };
import trailingVolume from '../test/fixtures/rest/users/self/trailing-volume/GET-200.json' assert { type: "json" };
import verifyPayload from '../test/fixtures/rest/users/self/verify/GET-200.json' assert {type: 'json'};
import trailingVolume from '../test/fixtures/rest/users/self/trailing-volume/GET-200.json' assert {type: 'json'};
import {UserAPI} from './UserAPI.js';

describe('UserAPI', () => {
Expand Down

0 comments on commit b853f86

Please sign in to comment.