Skip to content

Commit

Permalink
chore: Fix lint @typescript-eslint/array-type
Browse files Browse the repository at this point in the history
  • Loading branch information
dividedmind committed Apr 21, 2024
1 parent 071f870 commit 3967019
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/cmds/prune/prune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function parseSize(size: string) {
}

function generateConsoleMessage(filters: any): string {
let exclusions = [] as Array<any>;
let exclusions = [] as any[];

if ('hideUnlabeled' in filters) exclusions.push('All unlabeled functions');
if ('hideMediaRequests' in filters) exclusions.push('All media requests');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cmds/stats/accumulateEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function parseClassMap(mapPath: string): Promise<ClassMap> {
});
}

export async function accumulateEvents(mapPath: string): Promise<Array<EventInfo>> {
export async function accumulateEvents(mapPath: string): Promise<EventInfo[]> {
const classMap = await parseClassMap(mapPath);
const events = {};

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cmds/stats/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const builder = (args: yargs.Argv) => {
export async function handler(
argv: any,
handlerCaller = 'from_stats'
): Promise<Array<EventInfo> | Promise<[SortedAppMapSize[], SlowestExecutionTime[]]> | undefined> {
): Promise<EventInfo[] | Promise<[SortedAppMapSize[], SlowestExecutionTime[]]> | undefined> {
verbose(argv.verbose);
handleWorkingDirectory(argv.directory);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cmds/stats/statsForMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function statsForMap(
format: string,
limit: number,
mapPath: string
): Promise<Array<EventInfo>> {
): Promise<EventInfo[]> {
const eventsStats = (await accumulateEvents(mapPath)).slice(0, limit);

if (format === 'json') {
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/lib/loadAppMapConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export type HideOption =
// fields that are likely to be used for creating a canonical sequence diagram.
export type CompareFilter = {
hide_external?: boolean;
dependency_folders?: Array<string>;
hide_name?: Array<string>;
hide?: Array<HideOption>;
reveal?: Array<HideOption>;
dependency_folders?: string[];
hide_name?: string[];
hide?: HideOption[];
reveal?: HideOption[];
};

export interface CompareConfig {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/lib/processAppMapDir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export type TaskResultHandler<V> = (appmapFile: string, result: V) => void | Pro

export type ProcessResult = {
oversized: Set<string>;
errors: Array<Error>;
unhandledErrors: Array<Error>;
errors: Error[];
unhandledErrors: Error[];
numProcessed: number;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/search/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export interface EventMatch {
}

export interface CodeObjectMatchSpec {
tokens: Array<(codeObject: CodeObject) => boolean>;
tokens: ((codeObject: CodeObject) => boolean)[];
}

export interface Filter {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/unit/agentInstall/statusCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('status sub-command', () => {
});

it('chooses an installer when there are multiple options', async () => {
const installers: Array<AgentInstaller> = [];
const installers: AgentInstaller[] = [];
installers[0] = stubInterface<AgentInstaller>();
installers[1] = stubInterface<AgentInstaller>();

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/unit/lib/workerPool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('WorkerPool', () => {

const initializeWorkerPool = () => (workerPool = new WorkerPool(jobFile, numThreads));

const runTasks = async <T>(tasks: Array<T>): Promise<TaskResult> => {
const runTasks = async <T>(tasks: T[]): Promise<TaskResult> => {
const processTasks = async (cb: (err: Error | null, result: any) => void) => {
await Promise.all(
tasks.map((task) => {
Expand Down

0 comments on commit 3967019

Please sign in to comment.