Skip to content

Commit 477e163

Browse files
Use 'import type' for type-only imports in logger
Refactored imports in FileSink.ts, TextFormatter.ts, and defaults.ts to use 'import type' for type-only imports. This improves clarity and may help with tree-shaking and type checking.
1 parent c906826 commit 477e163

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/logger/FileSink.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {
1+
import type {
22
LoggingLevel,
33
MessageTemplateParams,
44
TimestampProvider,
@@ -7,7 +7,7 @@ import { defaultTimestamp } from "./defaults.ts";
77
import { Sink } from "./Sink.ts";
88
import { ensureFileSync } from "@std/fs";
99
import { TextFormatter } from "./TextFormatter.ts";
10-
import { Formatter } from "./Formatter.ts";
10+
import type { Formatter } from "./Formatter.ts";
1111
export class FileSink extends Sink {
1212
private _filepath: string;
1313
constructor(

src/logger/TextFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
defaultParamColorOptions,
77
defaultTimestampColorOption,
88
} from "./defaults.ts";
9-
import { Formatter, LoggingFormatterData } from "./Formatter.ts";
9+
import { Formatter, type LoggingFormatterData } from "./Formatter.ts";
1010
import { compileMessage } from "./parser.ts";
1111

1212
function spacingUntil(current: number, length: number): string {

src/logger/defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
white,
1414
yellow,
1515
} from "@std/fmt/colors";
16-
import { ColorFunction, LevelColors, ParamColors } from "./TextFormatter.ts";
16+
import type { ColorFunction, LevelColors, ParamColors } from "./TextFormatter.ts";
1717

1818
/**
1919
* Default color options for the `ConsoleSink` class.

0 commit comments

Comments
 (0)