Skip to content

Commit e18623a

Browse files
committed
Don't show desciption if there is none in alerts
1 parent de5f846 commit e18623a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/shadow/arborist.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,12 @@ async function packagesHaveRiskyIssues(
462462
if (type) {
463463
// Based data from { pageProps: { alertTypes } } of:
464464
// https://socket.dev/_next/data/94666139314b6437ee4491a0864e72b264547585/en-US.json
465-
const issueTypeTranslation = translations.issues[type]
465+
const info = translations.issues[type]
466+
const title = info?.title ?? type
467+
const maybeBlocking = failure.block ? '' : ' (non-blocking)'
468+
const maybeDesc = info?.description ? ` - ${info.description}` : ''
466469
// TODO: emoji seems to mis-align terminals sometimes
467-
lines.add(
468-
` ${issueTypeTranslation?.title ?? type}${failure.block ? '' : ' (non-blocking)'} - ${issueTypeTranslation?.description ?? ''}\n`
469-
)
470+
lines.add(` ${title}${maybeBlocking}${maybeDesc}\n`)
470471
}
471472
}
472473
for (const line of lines) {

0 commit comments

Comments
 (0)