Skip to content

Commit 1343c48

Browse files
authored
Merge pull request #30 from code-rabi/ci/knip-check
ci: add knip dead-code check
2 parents f24b71b + caed9d3 commit 1343c48

8 files changed

Lines changed: 47 additions & 13 deletions

File tree

.github/workflows/knip.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Knip
2+
3+
on:
4+
push:
5+
branches: [main, master, develop]
6+
pull_request:
7+
branches: [main, master, develop]
8+
9+
jobs:
10+
knip:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20.x'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run knip
27+
run: npx -y knip@5

knip.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema.json",
3+
"ignore": ["ib-gateway/**"],
4+
"ignoreDependencies": [
5+
"@semantic-release/commit-analyzer",
6+
"@semantic-release/github",
7+
"@semantic-release/npm",
8+
"@semantic-release/release-notes-generator",
9+
"conventional-changelog-conventionalcommits",
10+
"semantic-release"
11+
]
12+
}

src/flex-query-client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import axios, { AxiosInstance } from "axios";
22
import { Logger } from "./logger.js";
33
import { parseStringPromise } from "xml2js";
44

5-
export interface FlexQueryClientConfig {
5+
interface FlexQueryClientConfig {
66
token: string;
77
}
88

9-
export interface FlexQueryResponse {
9+
interface FlexQueryResponse {
1010
referenceCode?: string;
1111
url?: string;
1212
error?: string;
1313
errorCode?: string;
1414
}
1515

16-
export interface FlexStatementResponse {
16+
interface FlexStatementResponse {
1717
data?: string; // XML data
1818
error?: string;
1919
errorCode?: string;

src/flex-query-storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface SavedFlexQuery {
1212
lastUsed?: string;
1313
}
1414

15-
export interface FlexQueriesStore {
15+
interface FlexQueriesStore {
1616
queries: SavedFlexQuery[];
1717
}
1818

src/headless-auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface HeadlessAuthConfig {
1212
paperTrading?: boolean;
1313
}
1414

15-
export interface HeadlessAuthResult {
15+
interface HeadlessAuthResult {
1616
success: boolean;
1717
message: string;
1818
waitingFor2FA?: boolean;

src/ib-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ interface ExtendedAxiosRequestConfig extends AxiosRequestConfig {
66
metadata?: { requestId: string };
77
}
88

9-
export interface IBClientConfig {
9+
interface IBClientConfig {
1010
host: string;
1111
port: number;
1212
}
1313

14-
export interface OrderRequest {
14+
interface OrderRequest {
1515
accountId: string;
1616
symbol: string;
1717
action: "BUY" | "SELL";

src/server.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ export function createIBMCPServer({ config: userConfig }: { config: z.infer<type
8686
return server;
8787
}
8888

89-
export { gatewayManager };
90-
91-
92-
93-
9489

9590

9691

src/tool-handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface ToolHandlerContext {
3131
flexQueryStorage?: FlexQueryStorage;
3232
}
3333

34-
export type ToolHandlerResult = {
34+
type ToolHandlerResult = {
3535
content: Array<{
3636
type: "text";
3737
text: string;

0 commit comments

Comments
 (0)