Skip to content

Commit 01085e7

Browse files
committed
Automatically fix ESLint violations
1 parent 7f332e3 commit 01085e7

15 files changed

Lines changed: 42 additions & 53 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,8 @@ export class DistributionManager implements DistributionProvider {
195195

196196
if (process.env.PATH) {
197197
for (const searchDirectory of process.env.PATH.split(delimiter)) {
198-
const expectedLauncherPath = await getExecutableFromDirectory(
199-
searchDirectory,
200-
);
198+
const expectedLauncherPath =
199+
await getExecutableFromDirectory(searchDirectory);
201200
if (expectedLauncherPath) {
202201
return {
203202
codeQlPath: expectedLauncherPath,

extensions/ql-vscode/src/common/readonly.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export type DeepReadonly<T> = T extends Array<infer R>
22
? DeepReadonlyArray<R>
33
: // eslint-disable-next-line @typescript-eslint/ban-types
4-
T extends Function
5-
? T
6-
: T extends object
7-
? DeepReadonlyObject<T>
8-
: T;
4+
T extends Function
5+
? T
6+
: T extends object
7+
? DeepReadonlyObject<T>
8+
: T;
99

1010
interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}
1111

extensions/ql-vscode/src/common/sarif-utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,14 @@ export function parseHighlightedLine(
232232
const highlightStartColumn = isSingleLineHighlight
233233
? highlightedRegion.startColumn
234234
: isFirstHighlightedLine
235-
? highlightedRegion.startColumn
236-
: 0;
235+
? highlightedRegion.startColumn
236+
: 0;
237237

238238
const highlightEndColumn = isSingleLineHighlight
239239
? highlightedRegion.endColumn
240240
: isLastHighlightedLine
241-
? highlightedRegion.endColumn
242-
: line.length + 1;
241+
? highlightedRegion.endColumn
242+
: line.length + 1;
243243

244244
const plainSection1 = line.substring(0, highlightStartColumn - 1);
245245
const highlightedSection = line.substring(

extensions/ql-vscode/src/common/vscode/telemetry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ export class ExtensionTelemetryListener
162162
const status = !error
163163
? CommandCompletion.Success
164164
: error instanceof UserCancellationException
165-
? CommandCompletion.Cancelled
166-
: CommandCompletion.Failed;
165+
? CommandCompletion.Cancelled
166+
: CommandCompletion.Failed;
167167

168168
this.reporter.sendTelemetryEvent(
169169
"command-usage",

extensions/ql-vscode/src/databases/local-databases/database-manager.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,8 @@ export class DatabaseManager extends DisposableObject {
424424
step: ++step,
425425
});
426426

427-
const databaseItem = await this.createDatabaseItemFromPersistedState(
428-
database,
429-
);
427+
const databaseItem =
428+
await this.createDatabaseItemFromPersistedState(database);
430429
try {
431430
await this.refreshDatabase(databaseItem);
432431
await this.registerDatabase(databaseItem);

extensions/ql-vscode/src/extension.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ async function installOrUpdateDistribution(
542542
const messageText = willUpdateCodeQl
543543
? "Updating CodeQL CLI"
544544
: codeQlInstalled
545-
? "Checking for updates to CodeQL CLI"
546-
: "Installing CodeQL CLI";
545+
? "Checking for updates to CodeQL CLI"
546+
: "Installing CodeQL CLI";
547547

548548
try {
549549
await installOrUpdateDistributionWithProgressTitle(
@@ -564,8 +564,8 @@ async function installOrUpdateDistribution(
564564
willUpdateCodeQl
565565
? "update"
566566
: codeQlInstalled
567-
? "check for updates to"
568-
: "install"
567+
? "check for updates to"
568+
: "install"
569569
} CodeQL CLI`;
570570

571571
if (e instanceof GithubRateLimitedError) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ function sortInterpretedResults(
106106
a.message.text === undefined
107107
? 0
108108
: b.message.text === undefined
109-
? 0
110-
: multiplier *
111-
a.message.text?.localeCompare(b.message.text, env.language),
109+
? 0
110+
: multiplier *
111+
a.message.text?.localeCompare(b.message.text, env.language),
112112
);
113113
break;
114114
default:

extensions/ql-vscode/src/local-queries/skeleton-query-wizard.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,8 @@ export class SkeletonQueryWizard {
507507
): Promise<DatabaseItem | undefined> {
508508
const defaultDatabaseNwo = QUERY_LANGUAGE_TO_DATABASE_REPO[language];
509509

510-
const dbItems = await SkeletonQueryWizard.sortDatabaseItemsByDateAdded(
511-
databaseItems,
512-
);
510+
const dbItems =
511+
await SkeletonQueryWizard.sortDatabaseItemsByDateAdded(databaseItems);
513512

514513
const defaultDatabaseItem = await SkeletonQueryWizard.findDatabaseItemByNwo(
515514
language,

extensions/ql-vscode/src/model-editor/auto-model-codeml-queries.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ export async function runAutoModelQueries({
8585
// CodeQL needs to have access to the database to be able to retrieve the
8686
// snippets from it. The source location prefix is used to determine the
8787
// base path of the database.
88-
const sourceLocationPrefix = await databaseItem.getSourceLocationPrefix(
89-
cliServer,
90-
);
88+
const sourceLocationPrefix =
89+
await databaseItem.getSourceLocationPrefix(cliServer);
9190
const sourceArchiveUri = databaseItem.sourceArchive;
9291
const sourceInfo =
9392
sourceArchiveUri === undefined

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,8 @@ export class ModelEditorView extends AbstractWebview<
482482
// In application mode, we need the database of a specific library to generate
483483
// the modeled methods. In framework mode, we'll use the current database.
484484
if (mode === Mode.Application) {
485-
addedDatabase = await this.promptChooseNewOrExistingDatabase(
486-
progress,
487-
);
485+
addedDatabase =
486+
await this.promptChooseNewOrExistingDatabase(progress);
488487
if (!addedDatabase) {
489488
return;
490489
}
@@ -562,9 +561,8 @@ export class ModelEditorView extends AbstractWebview<
562561

563562
private async modelDependency(): Promise<void> {
564563
return withProgress(async (progress, token) => {
565-
const addedDatabase = await this.promptChooseNewOrExistingDatabase(
566-
progress,
567-
);
564+
const addedDatabase =
565+
await this.promptChooseNewOrExistingDatabase(progress);
568566
if (!addedDatabase || token.isCancellationRequested) {
569567
return;
570568
}

0 commit comments

Comments
 (0)