Skip to content

Commit 95550ee

Browse files
committed
fix(publint): with option name
1 parent 725e430 commit 95550ee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/features/publint.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import path from 'node:path'
22
import process from 'node:process'
33
import { dim } from 'ansis'
44
import Debug from 'debug'
5+
import { prettyName } from '../utils/logger'
56
import type { ResolvedOptions } from '../options'
67

78
const debug = Debug('tsdown:publint')
89

910
export 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

Comments
 (0)