Skip to content

Commit eb4a10b

Browse files
Run eslint --fix
1 parent 2796dda commit eb4a10b

File tree

25 files changed

+60
-69
lines changed

25 files changed

+60
-69
lines changed

extensions/ql-vscode/src/codeql-cli/cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ export function spawnServer(
18341834
}
18351835

18361836
let lastStdout: string | Buffer | undefined = undefined;
1837-
child.stdout!.on("data", (data) => {
1837+
child.stdout.on("data", (data) => {
18381838
lastStdout = data;
18391839
});
18401840
// Set up event listeners.
@@ -1853,9 +1853,9 @@ export function spawnServer(
18531853
void logger.log(`Last stdout was "${lastStdout.toString()}"`);
18541854
}
18551855
});
1856-
child.stderr!.on("data", stderrListener);
1856+
child.stderr.on("data", stderrListener);
18571857
if (stdoutListener !== undefined) {
1858-
child.stdout!.on("data", stdoutListener);
1858+
child.stdout.on("data", stdoutListener);
18591859
}
18601860

18611861
if (progressReporter !== undefined) {

extensions/ql-vscode/src/codeql-cli/distribution.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@ class ExtensionSpecificDistributionManager {
346346
"distributionFolderIndex",
347347
0,
348348
) ?? 0,
349-
release: (this.extensionContext.globalState.get(
350-
"distributionRelease",
351-
) ?? null) as Release | null,
349+
release:
350+
this.extensionContext.globalState.get("distributionRelease") ??
351+
null,
352352
};
353353

354354
// This may result in a race condition, but when this happens both processes should write the same file.

extensions/ql-vscode/src/common/vscode/selection-commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type SelectionCommand<T extends NotArray> = CreateSupertypeOf<
1818
TreeViewContextMultiSelectionCommandFunction<T> &
1919
TreeViewContextSingleSelectionCommandFunction<T> &
2020
ExplorerSelectionCommandFunction<T>,
21-
(singleItem: T, multiSelect?: T[] | undefined) => Promise<void>
21+
(singleItem: T, multiSelect?: T[]) => Promise<void>
2222
>;
2323

2424
export function createSingleSelectionCommand<T extends NotArray>(

extensions/ql-vscode/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export class QueryServerConfigListener
406406
): Promise<QueryServerConfigListener> {
407407
const codeQlPath =
408408
await distributionManager.getCodeQlPathWithoutVersionCheck();
409-
const config = new QueryServerConfigListener(codeQlPath!);
409+
const config = new QueryServerConfigListener(codeQlPath);
410410
if (distributionManager.onDidChangeDistribution) {
411411
config.push(
412412
distributionManager.onDidChangeDistribution(async () => {

extensions/ql-vscode/src/language-support/contextual/template-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class TemplateQueryReferenceProvider implements ReferenceProvider {
133133

134134
const locLinks: Location[] = [];
135135
for (const link of fileLinks) {
136-
if (link.targetRange!.contains(position)) {
136+
if (link.targetRange.contains(position)) {
137137
locLinks.push({
138138
range: link.originSelectionRange!,
139139
uri: link.originUri,

extensions/ql-vscode/src/language-support/language-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async function spawnLanguageServer(
7979
languageServerLogger.log(data.toString(), { trailingNewline: false }),
8080
progressReporter,
8181
);
82-
return { writer: child.stdin!, reader: child.stdout! };
82+
return { writer: child.stdin, reader: child.stdout };
8383
},
8484
);
8585
}

extensions/ql-vscode/src/local-queries/local-queries.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ import { LocalQueryRun } from "./local-query-run";
5656
import { createMultiSelectionCommand } from "../common/vscode/selection-commands";
5757
import { findLanguage } from "../codeql-cli/query-language";
5858
import type { QueryTreeViewItem } from "../queries-panel/query-tree-view-item";
59-
import { QueryLanguage, tryGetQueryLanguage } from "../common/query-language";
59+
import type { QueryLanguage } from "../common/query-language";
60+
import { tryGetQueryLanguage } from "../common/query-language";
6061
import type { LanguageContextStore } from "../language-context-store";
6162
import type { ExtensionApp } from "../common/vscode/extension-app";
6263
import type { DatabaseFetcher } from "../databases/database-fetcher";
@@ -184,7 +185,7 @@ export class LocalQueries extends DisposableObject {
184185
private async runQueries(fileURIs: Uri[]): Promise<void> {
185186
await withProgress(
186187
async (progress, token) => {
187-
const maxQueryCount = MAX_QUERIES.getValue() as number;
188+
const maxQueryCount = MAX_QUERIES.getValue();
188189
const [files, dirFound] = await gatherQlFiles(
189190
fileURIs.map((uri) => uri.fsPath),
190191
);

extensions/ql-vscode/src/local-queries/query-contents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { dbSchemeToLanguage } from "../common/query-language";
1515
*/
1616
export function getInitialQueryContents(language: string, dbscheme: string) {
1717
if (!language) {
18-
const dbschemeBase = basename(dbscheme) as keyof typeof dbSchemeToLanguage;
18+
const dbschemeBase = basename(dbscheme);
1919
language = dbSchemeToLanguage[dbschemeBase];
2020
}
2121

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class JoinOrderScanner {
202202
const metric = computeJoinOrderBadness(
203203
maxTupleCount,
204204
maxDependentPredicateSize,
205-
resultSize!,
205+
resultSize,
206206
);
207207
if (metric >= this.warningThreshold) {
208208
const message = `'${event.predicateName}@${event.raHash.substring(

extensions/ql-vscode/src/model-editor/library.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function parseLibraryFilename(filename: string): Library {
3232
semverRegex.lastIndex = 0;
3333

3434
// Find the last occurence of the regex within the library name
35-
// eslint-disable-next-line no-constant-condition
35+
3636
while (true) {
3737
const currentMatch = semverRegex.exec(libraryName);
3838
if (currentMatch === null) {

0 commit comments

Comments
 (0)