Skip to content

Commit

Permalink
Fix style things
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Sep 7, 2024
1 parent 58735d2 commit 4fbbeb7
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@ const failUnlessArray = (
export const failUnlessJsonObject = (
astNode: JsonAstNode,
file: JsonFile,
): Failure | void => {
): Failure | undefined => {
if (astNode.type !== 'object') {
return {
type: 'failure',
Expand Down
4 changes: 2 additions & 2 deletions src/caching/github-actions-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ export class GitHubActionsCache implements Cache {
],
(error: unknown) => {
if (error != null) {
reject(`tar error: ${String(error)}`);
reject(new Error(`tar error: ${String(error)}`));
} else {
resolve();
}
Expand Down Expand Up @@ -688,7 +688,7 @@ class GitHubActionsCacheHit implements CacheHit {
['--extract', '--file', tarballPath, '--gzip', '-P'],
(error: unknown) => {
if (error != null) {
reject(`tar error: ${String(error)}`);
reject(new Error(`tar error: ${String(error)}`));
} else {
resolve();
}
Expand Down
2 changes: 0 additions & 2 deletions src/fingerprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,13 @@ export class Fingerprint {

get string(): FingerprintString {
if (this.#str === undefined) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.#str = JSON.stringify(this.#data!) as FingerprintString;
}
return this.#str;
}

get data(): FingerprintData {
if (this.#data === undefined) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.#data = JSON.parse(this.#str!) as FingerprintData;
}
return this.#data;
Expand Down
3 changes: 0 additions & 3 deletions src/language-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

// jsonc-parser often uses 'any' when they mean 'unknown'. We might want to
// declare our own types for them, but for now, we'll just quiet down eslint.
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-argument */

import {
createConnection,
Expand Down Expand Up @@ -60,7 +58,6 @@ connection.onInitialize((init) => {
return result;
});

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function log(...values: unknown[]) {
for (const value of values) {
let message: string;
Expand Down
4 changes: 0 additions & 4 deletions src/logging/quiet/run-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ export class QuietRunLogger implements Disposable {
#encounteredFailures = false;
#servicesRunning = 0;
#servicesStarted = 0;
#servicesPersistedFromPreviousRun = 0;
#analysisInfo: AnalysisInfo | undefined = undefined;
#finishedScriptsWithCommands = new Set<ScriptReferenceString>();
#statusLineState: StatusLineState = 'initial';
Expand Down Expand Up @@ -200,7 +199,6 @@ export class QuietRunLogger implements Disposable {
// know.
for (const [key, state] of this.#running) {
if (state.service) {
instance.#servicesPersistedFromPreviousRun++;
instance.#servicesRunning++;
instance.#running.set(key, state);
instance.#markScriptAsFinished(state.scriptReference);
Expand Down Expand Up @@ -511,7 +509,6 @@ export class QuietRunLogger implements Disposable {
}
this.#encounteredFailures = true;
{
// eslint-disable-next-line @typescript-eslint/no-unused-vars
using _pause = this.#statusLineWriter.clearUntilDisposed();
this.#reportFailure(event);
}
Expand Down Expand Up @@ -616,7 +613,6 @@ export class QuietRunLogger implements Disposable {
if (state.service) {
// Pause the status line while we print this real quick, but then resume
// it.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
using _pause = this.#statusLineWriter.clearUntilDisposed();
if (event.stream === 'stdout') {
process.stdout.write(event.data);
Expand Down
2 changes: 0 additions & 2 deletions src/test/parallelism.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ test(
const name = `dep${i}`;
depNames.push(name);

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
packageJson.scripts![name] = 'wireit';
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
packageJson.wireit![name] = {command: command.command};
invocations.push(command.nextInvocation());
}
Expand Down
1 change: 0 additions & 1 deletion src/test/util/node-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
* SPDX-License-Identifier: Apache-2.0
*/

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
export const NODE_MAJOR_VERSION = Number(process.version.match(/\d+/)![0]);
2 changes: 1 addition & 1 deletion src/test/util/rig-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const rigTest = <T extends {rig?: WireitTestRig}>(
return async (context) => {
try {
return await runTest(context);
} catch (e) {
} catch {
console.log('Test failed, retrying...');
}
return await runTest(context);
Expand Down
10 changes: 5 additions & 5 deletions src/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class Watcher {
}

watch(): Promise<void> {
void this.#startRun();
this.#startRun();
return this.#finished.promise;
}

Expand Down Expand Up @@ -311,7 +311,7 @@ export class Watcher {
// fine and probably good, and is simpler than maintaining a separate
// "queued-debouncing" state.
this.#state = 'debouncing';
void this.#startDebounce();
this.#startDebounce();
return;
}
case 'running': {
Expand Down Expand Up @@ -342,12 +342,12 @@ export class Watcher {
switch (this.#state) {
case 'watching': {
this.#state = 'debouncing';
void this.#startDebounce();
this.#startDebounce();
return;
}
case 'debouncing': {
void this.#cancelDebounce();
void this.#startDebounce();
this.#cancelDebounce();
this.#startDebounce();
return;
}
case 'running': {
Expand Down
2 changes: 1 addition & 1 deletion vscode-extension/src/test/scripts/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function main() {
try {
await run();
return;
} catch (err) {
} catch {
console.error('Failed to run tests, retrying...');
}
// wait a few seconds before retrying
Expand Down

0 comments on commit 4fbbeb7

Please sign in to comment.