Skip to content

Commit

Permalink
style(lint): fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Feb 28, 2020
1 parent ea5a37a commit 1e09581
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
12 changes: 1 addition & 11 deletions src/cli/command/create-command/create-command.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import commander from "commander";
import {CommandAction, CommandActionOptions, CommandOptionType, CreateCommandOptions} from "./create-command-options";

// tslint:disable:no-any
/* eslint-disable @typescript-eslint/no-explicit-any */

/**
* Coerces the given option value into an acceptable data type
*
* @param type
* @param value
*/
function coerceOptionValue(
type: CommandOptionType,
Expand All @@ -33,10 +30,6 @@ function coerceOptionValue(

/**
* Formats the given option flags
*
* @param shortHand
* @param longHand
* @returns
*/
function formatOptionFlags(shortHand: string | undefined, longHand: string): string {
const formattedLongHand = `${longHand} [arg]`;
Expand Down Expand Up @@ -66,9 +59,6 @@ function formatCommandNameWithArgs<T extends CreateCommandOptions>(options: T):

/**
* Creates a new command
*
* @param options
* @param action
*/
export function createCommand<T extends CreateCommandOptions>(options: T, action: CommandAction<T>): void {
// Add the command to the program
Expand Down
16 changes: 4 additions & 12 deletions src/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,32 @@ export class Logger implements ILogger {

/**
* Logs info-related messages
*
* @param messages
*/
public info(...messages: string[]): void {
info(...messages: string[]): void {
if (this.logLevel < LogLevel.INFO) return;
console.log(chalk[this.INFO_COLOR](...messages));
}

/**
* Logs verbose-related messages
*
* @param messages
*/
public verbose(...messages: string[]): void {
verbose(...messages: string[]): void {
if (this.logLevel < LogLevel.VERBOSE) return;
console.log(chalk[this.VERBOSE_COLOR](...messages));
}

/**
* Logs debug-related messages
*
* @param messages
*/
public debug(...messages: string[]): void {
debug(...messages: string[]): void {
if (this.logLevel < LogLevel.DEBUG) return;
console.log(chalk[this.DEBUG_COLOR](...messages));
}

/**
* Logs warning-related messages
*
* @param messages
*/
public warn(...messages: string[]): void {
warn(...messages: string[]): void {
console.warn(chalk[this.WARNING_COLOR](`(!)`, ...messages));
}
}

0 comments on commit 1e09581

Please sign in to comment.