Skip to content

Commit

Permalink
eslint stylistic rules enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rylorin committed Dec 25, 2024
1 parent b008826 commit 492d9e2
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 135 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ yarn-error.log*
dist/
doc-dev/
junit.xml
reports/

docker/ibc/config.ini

Expand Down
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
prettier,
{
languageOptions: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.4",
"@smarttools/eslint-plugin-rxjs": "^1.0.9",
"@types/jest": "^29.5.14",
"@types/node": "^18.19.68",
"@types/source-map-support": "^0.5.10",
"ajv": "^8.17.1",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-formatter-junit": "^8.40.0",
"eslint-plugin-jest": "^28.10.0",
"eslint-plugin-prettier": "^5.2.1",
"jest": "^29.7.0",
Expand Down
8 changes: 4 additions & 4 deletions src/api-next/api-next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2209,12 +2209,12 @@ export class IBApiNext {

if (side == 0) {
// ask side
cachedRows = <Map<OrderBookRowPosition, OrderBookRow>>cached.asks;
changedRows = <Map<OrderBookRowPosition, OrderBookRow>>changed.asks;
cachedRows = <Map<OrderBookRowPosition, OrderBookRow>>cached.asks; // eslint-disable-line @typescript-eslint/consistent-type-assertions
changedRows = <Map<OrderBookRowPosition, OrderBookRow>>changed.asks; // eslint-disable-line @typescript-eslint/consistent-type-assertions
} else if (side == 1) {
// bid side
cachedRows = <Map<OrderBookRowPosition, OrderBookRow>>cached.bids;
changedRows = <Map<OrderBookRowPosition, OrderBookRow>>changed.bids;
cachedRows = <Map<OrderBookRowPosition, OrderBookRow>>cached.bids; // eslint-disable-line @typescript-eslint/consistent-type-assertions
changedRows = <Map<OrderBookRowPosition, OrderBookRow>>changed.bids; // eslint-disable-line @typescript-eslint/consistent-type-assertions
}

if (cachedRows === undefined || changedRows === undefined) {
Expand Down
4 changes: 2 additions & 2 deletions src/api-next/market-scanner/market-scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { ItemListUpdate } from "../common/item-list-update";

export type MarketScannerItemRank = number;

export type MarketScannerItem = {
export interface MarketScannerItem {
rank: MarketScannerItemRank;
contract: ContractDetails;
distance: string;
benchmark: string;
projection: string;
legStr: string;
};
}

export type MarketScannerRows = Map<MarketScannerItemRank, MarketScannerItem>;

Expand Down
4 changes: 2 additions & 2 deletions src/api-next/order/open-order.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Contract, Order, OrderState, OrderStatus } from "../..";

export type IBApiNextOrderStatus = {
export interface IBApiNextOrderStatus {
status: OrderStatus;
filled: number;
remaining: number;
Expand All @@ -11,7 +11,7 @@ export type IBApiNextOrderStatus = {
clientId?: number;
whyHeld?: string;
mktCapPrice?: number;
};
}

export interface OpenOrder {
orderId: number;
Expand Down
2 changes: 1 addition & 1 deletion src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Typescript implementation of the Interactive Brokers TWS (or IB Gateway) API.
*/
/* eslint @typescript-eslint/no-unsafe-declaration-merging:warn,@typescript-eslint/unified-signatures:warn */
/* eslint @typescript-eslint/no-unsafe-declaration-merging:warn,@typescript-eslint/unified-signatures:off */
import { EventEmitter } from "eventemitter3";
import {
DurationUnit,
Expand Down
2 changes: 1 addition & 1 deletion src/api/contract/contractDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export interface ContractDetails {
fundBlueSkyTerritories?: string;
fundDistributionPolicyIndicator?: FundDistributionPolicyIndicator;
fundAssetType?: FundAssetType;
ineligibilityReasonList?: Array<IneligibilityReason>;
ineligibilityReasonList?: IneligibilityReason[];
}

export default ContractDetails;
2 changes: 1 addition & 1 deletion src/core/api-next/subscription-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RegistryEntry {

/** Map of all active subscriptions, with reqId as key. */
public readonly subscriptions: Map<number, IBApiNextSubscription<unknown>> =
new Map();
new Map<number, IBApiNextSubscription<unknown>>();
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/core/io/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,10 @@ export class Decoder {
const reqId = this.readInt();
const nCount = this.readInt();

const theMap: Map<number, [string, string]> = new Map();
const theMap: Map<number, [string, string]> = new Map<
number,
[string, string]
>();
for (let i = 0; i < nCount; i++) {
const bitNumber = this.readInt();
const exchange = this.readStr();
Expand Down
128 changes: 6 additions & 122 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -983,21 +983,6 @@
natural-compare "^1.4.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/eslint-plugin@^7.18.0":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz#b16d3cf3ee76bf572fdf511e79c248bdec619ea3"
integrity sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==
dependencies:
"@eslint-community/regexpp" "^4.10.0"
"@typescript-eslint/scope-manager" "7.18.0"
"@typescript-eslint/type-utils" "7.18.0"
"@typescript-eslint/utils" "7.18.0"
"@typescript-eslint/visitor-keys" "7.18.0"
graphemer "^1.4.0"
ignore "^5.3.1"
natural-compare "^1.4.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.18.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.18.2.tgz#0379a2e881d51d8fcf7ebdfa0dd18eee79182ce2"
Expand All @@ -1009,17 +994,6 @@
"@typescript-eslint/visitor-keys" "8.18.2"
debug "^4.3.4"

"@typescript-eslint/parser@^7.18.0":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.18.0.tgz#83928d0f1b7f4afa974098c64b5ce6f9051f96a0"
integrity sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==
dependencies:
"@typescript-eslint/scope-manager" "7.18.0"
"@typescript-eslint/types" "7.18.0"
"@typescript-eslint/typescript-estree" "7.18.0"
"@typescript-eslint/visitor-keys" "7.18.0"
debug "^4.3.4"

"@typescript-eslint/rule-tester@^8.13.0":
version "8.18.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/rule-tester/-/rule-tester-8.18.2.tgz#964e46c6f5db77406611f72f3bf44544e3f6e2ca"
Expand All @@ -1032,14 +1006,6 @@
lodash.merge "4.6.2"
semver "^7.6.0"

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz#c928e7a9fc2c0b3ed92ab3112c614d6bd9951c83"
integrity sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==
dependencies:
"@typescript-eslint/types" "7.18.0"
"@typescript-eslint/visitor-keys" "7.18.0"

"@typescript-eslint/[email protected]":
version "8.13.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.13.0.tgz#2f4aed0b87d72360e64e4ea194b1fde14a59082e"
Expand All @@ -1056,16 +1022,6 @@
"@typescript-eslint/types" "8.18.2"
"@typescript-eslint/visitor-keys" "8.18.2"

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz#2165ffaee00b1fbbdd2d40aa85232dab6998f53b"
integrity sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==
dependencies:
"@typescript-eslint/typescript-estree" "7.18.0"
"@typescript-eslint/utils" "7.18.0"
debug "^4.3.4"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.18.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.18.2.tgz#5ad07e09002eee237591881df674c1c0c91ca52f"
Expand All @@ -1076,11 +1032,6 @@
debug "^4.3.4"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.18.0.tgz#b90a57ccdea71797ffffa0321e744f379ec838c9"
integrity sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==

"@typescript-eslint/[email protected]":
version "8.13.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.13.0.tgz#3f35dead2b2491a04339370dcbcd17bbdfc204d8"
Expand All @@ -1091,20 +1042,6 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.18.2.tgz#5ebad5b384c8aa1c0f86cee1c61bcdbe7511f547"
integrity sha512-Z/zblEPp8cIvmEn6+tPDIHUbRu/0z5lqZ+NvolL5SvXWT5rQy7+Nch83M0++XzO0XrWRFWECgOAyE8bsJTl1GQ==

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz#b5868d486c51ce8f312309ba79bdb9f331b37931"
integrity sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==
dependencies:
"@typescript-eslint/types" "7.18.0"
"@typescript-eslint/visitor-keys" "7.18.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
minimatch "^9.0.4"
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.13.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.13.0.tgz#db8c93dd5437ca3ce417a255fb35ddc3c12c3e95"
Expand Down Expand Up @@ -1133,16 +1070,6 @@
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.18.0.tgz#bca01cde77f95fc6a8d5b0dbcbfb3d6ca4be451f"
integrity sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@typescript-eslint/scope-manager" "7.18.0"
"@typescript-eslint/types" "7.18.0"
"@typescript-eslint/typescript-estree" "7.18.0"

"@typescript-eslint/[email protected]", "@typescript-eslint/utils@^8.13.0":
version "8.18.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.18.2.tgz#a2635f71904a84f9e47fe1b6f65a6d944ff1adf9"
Expand All @@ -1163,14 +1090,6 @@
"@typescript-eslint/types" "8.13.0"
"@typescript-eslint/typescript-estree" "8.13.0"

"@typescript-eslint/[email protected]":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz#0564629b6124d67607378d0f0332a0495b25e7d7"
integrity sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==
dependencies:
"@typescript-eslint/types" "7.18.0"
eslint-visitor-keys "^3.4.3"

"@typescript-eslint/[email protected]":
version "8.13.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.13.0.tgz#e97b0d92b266ef38a1faf40a74da289b66683a5b"
Expand Down Expand Up @@ -1268,11 +1187,6 @@ argparse@^2.0.1:
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

array-union@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==

async@^3.2.3:
version "3.2.5"
resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66"
Expand Down Expand Up @@ -1587,13 +1501,6 @@ diff-sequences@^29.6.3:
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921"
integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==

dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==
dependencies:
path-type "^4.0.0"

dotenv@^16.4.7:
version "16.4.7"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.7.tgz#0e20c5b82950140aa99be360a8a5f52335f53c26"
Expand Down Expand Up @@ -1658,6 +1565,11 @@ eslint-config-prettier@^9.1.0:
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f"
integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==

eslint-formatter-junit@^8.40.0:
version "8.40.0"
resolved "https://registry.yarnpkg.com/eslint-formatter-junit/-/eslint-formatter-junit-8.40.0.tgz#118e2b9a777b23728b8e4e839856854ff9b98c6f"
integrity sha512-brB5r40UlMbd/BcmPIxUy/UA4GSGkuA1YRTDX4I5mEjra1asxmjUTWetf65JqVMo2kg96ZIZjRutktcHCIy+Gw==

eslint-plugin-jest@^28.10.0:
version "28.10.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.10.0.tgz#4b35b8abb0f7cfe699bff8d9060270a2ddd770ea"
Expand Down Expand Up @@ -1826,17 +1738,6 @@ fast-diff@^1.1.2:
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0"
integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==

fast-glob@^3.2.9:
version "3.3.1"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4"
integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-glob@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
Expand Down Expand Up @@ -2003,18 +1904,6 @@ globals@^14.0.0:
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==

globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
dependencies:
array-union "^2.1.0"
dir-glob "^3.0.1"
fast-glob "^3.2.9"
ignore "^5.2.0"
merge2 "^1.4.1"
slash "^3.0.0"

graceful-fs@^4.2.9:
version "4.2.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
Expand Down Expand Up @@ -2804,7 +2693,7 @@ merge-stream@^2.0.0:
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==

merge2@^1.3.0, merge2@^1.4.1:
merge2@^1.3.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
Expand Down Expand Up @@ -2983,11 +2872,6 @@ path-parse@^1.0.7:
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==

path-type@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==

picocolors@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
Expand Down

0 comments on commit 492d9e2

Please sign in to comment.