Skip to content

Commit dc5d8da

Browse files
committed
Autofix @typescript-eslint/array-type
1 parent 0b9ba3c commit dc5d8da

18 files changed

Lines changed: 27 additions & 26 deletions

extensions/ql-vscode/.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ module.exports = {
3232
ignoreRestSiblings: false,
3333
},
3434
],
35-
"@typescript-eslint/array-type": "off",
3635
"@typescript-eslint/explicit-function-return-type": "off",
3736
"@typescript-eslint/explicit-module-boundary-types": "off",
3837
"@typescript-eslint/no-non-null-assertion": "off",

extensions/ql-vscode/src/abstract-webview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export abstract class AbstractWebview<
3232
> extends DisposableObject {
3333
protected panel: WebviewPanel | undefined;
3434
protected panelLoaded = false;
35-
protected panelLoadedCallBacks: (() => void)[] = [];
35+
protected panelLoadedCallBacks: Array<() => void> = [];
3636

3737
private panelResolves?: Array<(panel: WebviewPanel) => void>;
3838

extensions/ql-vscode/src/archive-filesystem-provider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ export class ArchiveFileSystemProvider implements vscode.FileSystemProvider {
209209
return await this._lookup(uri);
210210
}
211211

212-
async readDirectory(uri: vscode.Uri): Promise<[string, vscode.FileType][]> {
212+
async readDirectory(
213+
uri: vscode.Uri,
214+
): Promise<Array<[string, vscode.FileType]>> {
213215
const ref = decodeSourceArchiveUri(uri);
214216
const archive = await this.getArchive(ref.sourceArchiveZipPath);
215217
const contents = archive.dirMap.get(ref.pathWithinSourceArchive);

extensions/ql-vscode/src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class CodeQLCliServer implements Disposable {
166166
/** The process for the cli server, or undefined if one doesn't exist yet */
167167
process?: child_process.ChildProcessWithoutNullStreams;
168168
/** Queue of future commands*/
169-
commandQueue: (() => void)[];
169+
commandQueue: Array<() => void>;
170170
/** Whether a command is running */
171171
commandInProcess: boolean;
172172
/** A buffer with a single null byte. */
@@ -915,7 +915,7 @@ export class CodeQLCliServer implements Disposable {
915915

916916
// Warning: this function is untenable for large dot files,
917917
async readDotFiles(dir: string): Promise<string[]> {
918-
const dotFiles: Promise<string>[] = [];
918+
const dotFiles: Array<Promise<string>> = [];
919919
for await (const file of walkDirectory(dir)) {
920920
if (file.endsWith(".dot")) {
921921
dotFiles.push(fs.readFile(file, "utf8"));

extensions/ql-vscode/src/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ export class CachedOperation<U> {
460460
private readonly lru: string[];
461461
private readonly inProgressCallbacks: Map<
462462
string,
463-
[(u: U) => void, (reason?: any) => void][]
463+
Array<[(u: U) => void, (reason?: any) => void]>
464464
>;
465465

466466
constructor(
@@ -471,7 +471,7 @@ export class CachedOperation<U> {
471471
this.lru = [];
472472
this.inProgressCallbacks = new Map<
473473
string,
474-
[(u: U) => void, (reason?: any) => void][]
474+
Array<[(u: U) => void, (reason?: any) => void]>
475475
>();
476476
this.cached = new Map<string, U>();
477477
}
@@ -499,7 +499,7 @@ export class CachedOperation<U> {
499499
}
500500

501501
// Otherwise compute the new value, but leave a callback to allow sharing work
502-
const callbacks: [(u: U) => void, (reason?: any) => void][] = [];
502+
const callbacks: Array<[(u: U) => void, (reason?: any) => void]> = [];
503503
this.inProgressCallbacks.set(t, callbacks);
504504
try {
505505
const result = await this.operation(t, ...args);

extensions/ql-vscode/src/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ export class ResultsView extends AbstractWebview<
825825
return;
826826
}
827827

828-
const diagnostics: [Uri, ReadonlyArray<Diagnostic>][] = [];
828+
const diagnostics: Array<[Uri, readonly Diagnostic[]]> = [];
829829

830830
for (const result of data.runs[0].results) {
831831
const message = result.message.text;

extensions/ql-vscode/src/legacy-query-server/queryserver-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class QueryServerClient extends DisposableObject {
4747
nextProgress: number;
4848
withProgressReporting: WithProgressReporting;
4949

50-
private readonly queryServerStartListeners = [] as ProgressTask<void>[];
50+
private readonly queryServerStartListeners = [] as Array<ProgressTask<void>>;
5151

5252
// Can't use standard vscode EventEmitter here since they do not cause the calling
5353
// function to fail if one of the event handlers fail. This is something that

extensions/ql-vscode/src/log-insights/join-order.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class JoinOrderScanner implements EvaluationLogScanner {
149149
private readonly predicateSizes = new Map<string, number>();
150150
private readonly layerEvents = new Map<
151151
string,
152-
(ComputeRecursive | InLayer)[]
152+
Array<ComputeRecursive | InLayer>
153153
>();
154154
// Map a key of the form 'query-with-demand : predicate name' to its badness input.
155155
private readonly maxTupleCountMap = new Map<string, number[]>();

extensions/ql-vscode/src/query-server/queryserver-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class QueryServerClient extends DisposableObject {
4444
nextProgress: number;
4545
withProgressReporting: WithProgressReporting;
4646

47-
private readonly queryServerStartListeners = [] as ProgressTask<void>[];
47+
private readonly queryServerStartListeners = [] as Array<ProgressTask<void>>;
4848

4949
// Can't use standard vscode EventEmitter here since they do not cause the calling
5050
// function to fail if one of the event handlers fail. This is something that

extensions/ql-vscode/src/remote-queries/analyses-results-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class AnalysesResultsManager {
112112
const taskResults = await Promise.allSettled(batchTasks);
113113
const failedTasks = taskResults.filter(
114114
(x) => x.status === "rejected",
115-
) as Array<PromiseRejectedResult>;
115+
) as PromiseRejectedResult[];
116116
if (failedTasks.length > 0) {
117117
const failures = failedTasks.map((t) => t.reason.message);
118118
failures.forEach((f) => void this.logger.log(f));

0 commit comments

Comments
 (0)