diff --git a/src/consola.ts b/src/consola.ts index af6b55b..baefd8f 100644 --- a/src/consola.ts +++ b/src/consola.ts @@ -193,7 +193,7 @@ export class Consola { removeReporter(reporter: ConsolaReporter) { if (reporter) { const i = this.options.reporters.indexOf(reporter); - if (i >= 0) { + if (i !== -1) { return this.options.reporters.splice(i, 1); } } else { diff --git a/src/utils/prompt.ts b/src/utils/prompt.ts index e08cca1..af7ac2d 100644 --- a/src/utils/prompt.ts +++ b/src/utils/prompt.ts @@ -840,7 +840,7 @@ export const note = (message = "", title = "") => { // eslint-disable-next-line unicorn/no-array-reduce lines.reduce((sum, ln) => { ln = strip(ln); - return ln.length > sum ? ln.length : sum; + return Math.max(ln.length, sum); }, 0), strip(title).length, ) + 2;