unjs / consola

🐨 Elegant Console Logger for Node.js and Browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BasicReporterOptions/FormatOptions incorrectly typed to nodejs util.InspectOptions

JustinGrote opened this issue · comments

Currently I cannot derive from BasicReporter due to this.

formatOptions?: InspectOptions;

Workaround patch for patch-package:

diff --git a/node_modules/consola/types/consola.d.ts b/node_modules/consola/types/consola.d.ts
index f98f7aa..bdc31e6 100644
--- a/node_modules/consola/types/consola.d.ts
+++ b/node_modules/consola/types/consola.d.ts
@@ -1,4 +1,3 @@
-import { InspectOptions } from 'util';
 
 export enum LogLevel {
   Fatal= 0,
@@ -125,9 +124,14 @@ export declare class Consola {
   mock(mockFn: ConsolaMockFn): any
 }
 
+interface BasicReporterFormatOptions {
+    date?: boolean,
+    colors?: boolean,
+    compact?: boolean
+}
 export interface BasicReporterOptions {
   dateFormat?: string;
-  formatOptions?: InspectOptions;
+  formatOptions?: BasicReporterFormatOptions;
 }

 
 export declare class BasicReporter implements ConsolaReporter {

Thanks for reporting. Consola v3 should allow this via top level formatOptions