@@ -2,14 +2,18 @@ import path from 'node:path'
22import process from 'node:process'
33import { dim } from 'ansis'
44import Debug from 'debug'
5+ import { prettyName } from '../utils/logger'
56import type { ResolvedOptions } from '../options'
67
78const debug = Debug ( 'tsdown:publint' )
89
910export async function publint ( options : ResolvedOptions ) : Promise < void > {
1011 if ( ! options . publint ) return
1112 if ( ! options . pkg ) {
12- options . logger . warn ( 'publint is enabled but package.json is not found' )
13+ options . logger . warn (
14+ prettyName ( options . name ) ,
15+ 'publint is enabled but package.json is not found' ,
16+ )
1317 return
1418 }
1519
@@ -25,6 +29,7 @@ export async function publint(options: ResolvedOptions): Promise<void> {
2529
2630 if ( ! messages . length ) {
2731 options . logger . success (
32+ prettyName ( options . name ) ,
2833 `No publint issues found` ,
2934 dim `(${ Math . round ( performance . now ( ) - t ) } ms)` ,
3035 )
@@ -36,7 +41,7 @@ export async function publint(options: ResolvedOptions): Promise<void> {
3641 const logType = (
3742 { error : 'error' , warning : 'warn' , suggestion : 'info' } as const
3843 ) [ message . type ]
39- options . logger [ logType ] ( formattedMessage )
44+ options . logger [ logType ] ( prettyName ( options . name ) , formattedMessage )
4045 }
4146 if ( hasError ) {
4247 debug ( 'Found errors, setting exit code to 1' )
0 commit comments