Skip to content

Commit

Permalink
Add readonly to a few props and types
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Jul 17, 2024
1 parent df4c496 commit 3319db5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export async function selectTasks(
d: Pick<D, "simplifyPath">,
herebyfile: Herebyfile,
herebyfilePath: string,
taskNames: string[],
): Promise<Task[]> {
taskNames: readonly string[],
): Promise<readonly Task[]> {
if (taskNames.length === 0) {
if (herebyfile.defaultTask) return [herebyfile.defaultTask];
throw new UserError(
Expand Down
10 changes: 5 additions & 5 deletions src/cli/parseArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import minimist from "minimist";
import type { TaskFormat } from "./formatTasks.js";

interface CLIOptions {
help: boolean;
run: string[];
herebyfile: string | undefined;
printTasks: TaskFormat | undefined;
version: boolean;
readonly help: boolean;
readonly run: readonly string[];
readonly herebyfile: string | undefined;
readonly printTasks: TaskFormat | undefined;
readonly version: boolean;
}

export function parseArgs(argv: string[]): CLIOptions {
Expand Down
6 changes: 3 additions & 3 deletions src/cli/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import type { D } from "./utils.js";
export type RunnerD = Pick<D, "log" | "error" | "prettyMilliseconds">;

export class Runner {
private _addedTasks = new Map<Task, Promise<void>>();
private readonly _addedTasks = new Map<Task, Promise<void>>();

private _errored = false;
private _startTimes = new Map<Task, number>();
private readonly _startTimes = new Map<Task, number>();

constructor(private _d: RunnerD) {}
constructor(private readonly _d: RunnerD) {}

async runTasks(...tasks: Task[]): Promise<void> {
// Using allSettled here so that we don't immediately exit; it could be
Expand Down

0 comments on commit 3319db5

Please sign in to comment.