Skip to content

Commit ab1f8b6

Browse files
committed
fix(utils): resolve all remaining ESLint violations
1 parent dff64bd commit ab1f8b6

30 files changed

+129
-82
lines changed

packages/algorithms/src/extraction/path.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
* Citation path analysis utilities for graph extraction.
33
* Provides shortest path finding and reachability subgraph extraction.
44
*/
5+
import { bfs } from '@bibgraph/graph-expansion';
6+
57
import { Graph } from '../graph/graph';
68
import { GraphAdapter } from '../graph-adapter';
7-
import { bfs } from '@bibgraph/graph-expansion';
89
import { dijkstra } from '../pathfinding/dijkstra';
910
import type { Path } from '../types/algorithm-results';
1011
import type { ExtractionError } from '../types/errors';

packages/algorithms/src/pathfinding/mutual-information.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ const computeHyperedgeMI = (
436436

437437
/**
438438
* Get the set of neighbour IDs for a node.
439+
* @param graph
440+
* @param nodeId
439441
* @internal
440442
*/
441443
const getNeighbourSet = <N extends Node, E extends Edge>(

packages/algorithms/src/pathfinding/path-ranking.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,9 @@ export const createPathRanker = <N extends Node, E extends Edge>(
610610
return {
611611
/**
612612
* Rank paths between two nodes.
613+
* @param startId
614+
* @param endId
615+
* @param overrides
613616
*/
614617
rank: (
615618
startId: string,
@@ -619,6 +622,9 @@ export const createPathRanker = <N extends Node, E extends Edge>(
619622

620623
/**
621624
* Get the best path between two nodes.
625+
* @param startId
626+
* @param endId
627+
* @param overrides
622628
*/
623629
getBest: (
624630
startId: string,

packages/graph-core/src/graph-adapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* @module adapters/graph-adapter
99
*/
1010

11-
import type { ReadableGraph, NodeBase, EdgeBase } from '@bibgraph/graph-expansion';
12-
import { type Graph, type Node, type Edge } from '@bibgraph/algorithms';
11+
import { type Edge,type Graph, type Node } from '@bibgraph/algorithms';
12+
import type { ReadableGraph } from '@bibgraph/graph-expansion';
1313

1414
/**
1515
* Adapts the algorithms Graph class to the ReadableGraph interface.

packages/graph-expansion/src/extraction/ego-network.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export type Result<T, E> = Ok<T> | Err<E>;
6060

6161
/**
6262
* Validate ego network extraction options.
63+
* @param graph
64+
* @param options
6365
*/
6466
const validateEgoNetworkOptions = <N extends NodeBase, E extends EdgeBase>(
6567
graph: ReadableGraph<N, E>,
@@ -190,6 +192,9 @@ export const extractEgoNetwork = <N extends NodeBase, E extends EdgeBase>(
190192

191193
/**
192194
* Discovers all nodes within a given radius using BFS with distance tracking.
195+
* @param graph
196+
* @param startId
197+
* @param maxRadius
193198
*/
194199
const discoverNodesWithinRadius = <N extends NodeBase, E extends EdgeBase>(
195200
graph: ReadableGraph<N, E>,
@@ -233,6 +238,8 @@ const discoverNodesWithinRadius = <N extends NodeBase, E extends EdgeBase>(
233238

234239
/**
235240
* Extracts an induced subgraph containing only the specified nodes and edges between them.
241+
* @param graph
242+
* @param nodeIds
236243
*/
237244
const extractInducedSubgraph = <N extends NodeBase, E extends EdgeBase>(
238245
graph: ReadableGraph<N, E>,

packages/graph-expansion/src/extraction/ego-network.unit.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/**
22
* Unit tests for ego-network extraction algorithm
33
*/
4-
import { describe, it, expect, beforeEach } from 'vitest';
4+
import { beforeEach,describe, expect, it } from 'vitest';
5+
6+
import type { EdgeBase,NodeBase, ReadableGraph } from '../interfaces/readable-graph';
57
import {
68
extractEgoNetwork,
79
extractMultiSourceEgoNetwork,
810
} from './ego-network';
9-
import type { ReadableGraph, NodeBase, EdgeBase } from '../interfaces/readable-graph';
1011

1112
interface TestNode extends NodeBase {
1213
id: string;
@@ -55,19 +56,19 @@ class TestGraph implements ReadableGraph<TestNode, TestEdge> {
5556
}
5657

5758
getNeighbors(id: string): string[] {
58-
return Array.from(this.adjacency.get(id) || []);
59+
return [...this.adjacency.get(id) || []];
5960
}
6061

6162
getAllNodes(): TestNode[] {
62-
return Array.from(this.nodes.values());
63+
return [...this.nodes.values()];
6364
}
6465

6566
isDirected(): boolean {
6667
return this.directed;
6768
}
6869

6970
getOutgoingEdges(id: string): TestEdge[] {
70-
return Array.from(this.edges.values()).filter(
71+
return [...this.edges.values()].filter(
7172
e => e.source === id || (!this.directed && e.target === id)
7273
);
7374
}

packages/graph-expansion/src/fixtures/mock-graph-expander.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { GraphExpander, Neighbor } from '@bibgraph/graph-expansion';
2-
import type { TestGraph, TestNode, TestEdge } from '@bibgraph/graph-gen';
2+
import type { TestEdge,TestGraph, TestNode } from '@bibgraph/graph-gen';
33

44
/**
55
* Mock implementation of GraphExpander for testing bidirectional BFS.

packages/graph-expansion/src/traversal/bfs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export type Result<T, E> = Ok<T> | Err<E>;
7171

7272
/**
7373
* Breadth-First Search traversal.
74+
* @param graph
75+
* @param startId
7476
*/
7577
export const bfs = <N extends NodeBase, E extends EdgeBase>(
7678
graph: ReadableGraph<N, E>,

packages/graph-expansion/src/traversal/bfs.unit.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
22
* Unit tests for BFS traversal algorithm
33
*/
4-
import { describe, it, expect, beforeEach } from 'vitest';
4+
import { beforeEach,describe, expect, it } from 'vitest';
5+
6+
import type { EdgeBase,NodeBase, ReadableGraph } from '../interfaces/readable-graph';
57
import { bfs } from './bfs';
6-
import type { ReadableGraph, NodeBase, EdgeBase } from '../interfaces/readable-graph';
78

89
interface TestNode extends NodeBase {
910
id: string;
@@ -52,19 +53,19 @@ class TestGraph implements ReadableGraph<TestNode, TestEdge> {
5253
}
5354

5455
getNeighbors(id: string): string[] {
55-
return Array.from(this.adjacency.get(id) || []);
56+
return [...this.adjacency.get(id) || []];
5657
}
5758

5859
getAllNodes(): TestNode[] {
59-
return Array.from(this.nodes.values());
60+
return [...this.nodes.values()];
6061
}
6162

6263
isDirected(): boolean {
6364
return this.directed;
6465
}
6566

6667
getOutgoingEdges(id: string): TestEdge[] {
67-
return Array.from(this.edges.values()).filter(
68+
return [...this.edges.values()].filter(
6869
e => e.source === id || (!this.directed && e.target === id)
6970
);
7071
}

packages/graph-expansion/src/traversal/bidirectional-bfs-fixtures.unit.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { describe, test, expect } from 'vitest';
2-
import { BidirectionalBFS } from './bidirectional-bfs';
1+
import { generateGraph, makeGraphSpec } from '@bibgraph/graph-gen';
2+
import { describe, expect,test } from 'vitest';
3+
34
import { MockGraphExpander } from '../fixtures/mock-graph-expander';
4-
import { generateGraph, makeGraphSpec, type GraphSpec } from '@bibgraph/graph-gen';
5+
import { BidirectionalBFS } from './bidirectional-bfs';
56

67
describe('BidirectionalBFS with Test Fixtures', () => {
78
describe('Simple canonical graphs', () => {

0 commit comments

Comments
 (0)