Skip to content

Commit

Permalink
chore: fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaRedHand committed Feb 1, 2025
1 parent 989f920 commit b90d5f4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
4 changes: 3 additions & 1 deletion src/programs/echo_sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export class SingleEcho extends EchoSender {
this.signalStop();
}

protected _stop() {}
protected _stop() {
// Nothing to do
}

static getProgramInfo(viewgraph: ViewGraph, srcId: DeviceId): ProgramInfo {
const programInfo = new ProgramInfo(this.PROGRAM_NAME);
Expand Down
13 changes: 6 additions & 7 deletions src/programs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ export interface Program {
}

/**
* This interface matches a class having a constructor with the given signature
* This type matches a class having a constructor with the given signature
*/
interface ProgramConstructor {
/**
* Creates a Program from the given inputs
*/
new (viewgraph: ViewGraph, srcId: DeviceId, inputs: string[]): Program;
}
type ProgramConstructor = new (
viewgraph: ViewGraph,
srcId: DeviceId,
inputs: string[],
) => Program;

// List of all programs.
// Each one has to:
Expand Down
5 changes: 0 additions & 5 deletions src/types/devices/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import PcImage from "../../assets/pc.svg";
import { Position } from "../common";
import { IpAddress } from "../../packets/ip";
import { DeviceInfo, RightBar } from "../../graphics/right_bar";
import { ProgramInfo } from "../../graphics/renderables/device_info";
import { sendPacket } from "../packet";
import { Ticker } from "pixi.js";
import { DeviceId } from "../graphs/datagraph";
import { Layer } from "./layer";
import { isHost } from "../graphs/datagraph";
Expand All @@ -18,8 +15,6 @@ import {
RunningProgram,
} from "../../programs";

const ECHO_SERVER_NAME = "Echo server";

export class Host extends Device {
private runningPrograms = new Map<Pid, Program>();
private lastProgramId = 0;
Expand Down
8 changes: 1 addition & 7 deletions src/types/packet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ import { circleGraphicsContext, Colors, ZIndexLevels } from "../utils";
import { RightBar, StyledInfo } from "../graphics/right_bar";
import { Position } from "./common";
import { ViewGraph } from "./graphs/viewgraph";
import {
EmptyPayload,
ICMP_PROTOCOL_NUMBER,
IpAddress,
IPv4Packet,
} from "../packets/ip";
import { EmptyPayload, IpAddress, IPv4Packet } from "../packets/ip";
import { EchoRequest, EchoReply } from "../packets/icmp";
import { DeviceId, isRouter } from "./graphs/datagraph";
import { EthernetFrame } from "../packets/ethernet";

const contextPerPacketType: Record<string, GraphicsContext> = {
IP: circleGraphicsContext(Colors.Green, 0, 0, 5),
Expand Down

0 comments on commit b90d5f4

Please sign in to comment.