Skip to content

Commit

Permalink
chore: Fix lint @typescript-eslint/no-inferrable-types
Browse files Browse the repository at this point in the history
  • Loading branch information
dividedmind committed Apr 21, 2024
1 parent 6984417 commit 071f870
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/cmds/agentInstaller/commandRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { verbose } from '../../utils';
import { ChildProcessError } from '../errors';

export class ProcessLog {
public static buffer: string = '';
public static buffer = '';

public static log(command: string, childProcess: ChildProcess) {
this.buffer = this.buffer.concat(`\n\nRunning command: \`${command}\`\n\n`);
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/cmds/agentInstaller/gradleParser.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import moo from 'moo';

class SourceOffsets {
braceIdx: number = 1;
braceIdx = 1;
// A syntactically correct build file will always have an rbrace to match the
// lbrace.
rbrace: number = -1;
rbrace = -1;
constructor(readonly blockName: string, readonly lbrace: number) {}
}

Expand Down Expand Up @@ -45,7 +45,7 @@ export type GradleParseResult = {
} & { [k in keyof Keywords]?: SourceOffsets };

export class GradleParser {
public debug: number = 0;
public debug = 0;

/**
* Parse the given gradle source, returning a GradleParseResult describing what we found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class PipenvInstaller extends PythonInstaller {

export class PipInstaller extends PythonInstaller {
static identifier = 'pip';
private _buildFile: string = 'requirements.txt';
private _buildFile = 'requirements.txt';

constructor(path: string) {
super(PipInstaller.identifier, path);
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 @@ -75,7 +75,7 @@ export const builder = (args: yargs.Argv) => {

export async function handler(
argv: any,
handlerCaller: string = 'from_stats'
handlerCaller = 'from_stats'
): Promise<Array<EventInfo> | Promise<[SortedAppMapSize[], SlowestExecutionTime[]]> | undefined> {
verbose(argv.verbose);
handleWorkingDirectory(argv.directory);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/cmds/stats/statsForDirectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function statsForDirectory(
appMapDir: string,
format: string,
limit: number,
handlerCaller: string = 'from_stats'
handlerCaller = 'from_stats'
): Promise<[SortedAppMapSize[], SlowestExecutionTime[]]> {
async function calculateAppMapSizes(appMapDir: string): Promise<AppMapSizeTable> {
const appMapSizes: AppMapSizeTable = {};
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/fingerprint/fingerprintDirectoryCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import FingerprintQueue from './fingerprintQueue';
import emitUsage from '../lib/emitUsage';

class FingerprintDirectoryCommand {
private appmaps: number = 0;
private events: number = 0;
private appmaps = 0;
private events = 0;
private metadata?: Metadata;

constructor(private readonly directory: string) {}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/ticket/openTicket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isValidEmail, isValidName } from './validation';
export default async function openTicket(
errors: string | string[],
helpMsg: string = DEFAULT_HELP_MSG,
prompt: boolean = true
prompt = true
): Promise<void> {
errors = !Array.isArray(errors) ? [errors] : errors;

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/rpc/explain/navie/navie-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class LocalNavie extends EventEmitter implements INavie {
this.emit('complete');
}

#skipTelemetry: boolean = !Telemetry.enabled;
#skipTelemetry = !Telemetry.enabled;

#reportConfigTelemetry() {
if (this.#skipTelemetry) return;
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/tests/unit/agentInstall/agentInstaller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import AgentInstaller from '../../../src/cmds/agentInstaller/agentInstaller';
import commandStruct from '../../../src/cmds/agentInstaller/commandStruct';

class FakeInstaller extends AgentInstaller {
public buildFile: string = 'bf';
public documentation: string = 'http://www.example.com';
public buildFile = 'bf';
public documentation = 'http://www.example.com';
constructor(path: string) {
super('Fake', path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const invokeCommand = (
if (err) throw err;
}
) => {
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
const debugSwitch: string = ''; // to debug, set debugSwitch to -v

if (debugSwitch !== '-v') {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/unit/lib/openTicket.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getNthCallArgs = (stub, nth) => (stub as sinon.SinonStub).getCall(nth).arg

class TestErrorResponse implements HttpErrorResponse {
headers: Record<string, string> = {};
body: string = '';
body = '';
toString(): string {
return `${JSON.stringify(this)}`;
}
Expand Down

0 comments on commit 071f870

Please sign in to comment.