Skip to content

Commit 6c1cb48

Browse files
committed
more logs
1 parent 56c636e commit 6c1cb48

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.changeset/fluffy-beds-cover.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@kitql/eslint-config': patch
3+
---
4+
5+
adding time took in fail mode as well

packages/eslint-config/cmd.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ const took = []
312312
const display = (text, time) => {
313313
return `${gray(text)} ${green((time / 1000).toFixed(3))}${gray('s')}`
314314
}
315+
const displayTook = () => `${gray('(')}${took.join(gray(', '))}${gray(')')}`
315316

316317
// If changed-only flag is set, get the list of changed files
317318
if (diffOnly) {
@@ -335,7 +336,7 @@ if (!prettierOnly && glob) {
335336
took.push(display('eslint', esLintTook))
336337
if (eslintCode.status) {
337338
spinner.prefixText = bgRedBright(` kitql-lint `)
338-
spinner.fail(red(`eslint failed, check logs above.`))
339+
spinner.fail(red(`eslint failed, check logs above. ${displayTook()}`))
339340
process.exit(eslintCode.status)
340341
}
341342
}
@@ -347,14 +348,16 @@ if (!eslintOnly && glob) {
347348
took.push(display('prettier', prettierTook))
348349
if (prettierCode.status) {
349350
spinner.prefixText = bgRedBright(` kitql-lint `)
350-
spinner.fail(red(`prettier failed, check logs above.`))
351+
spinner.fail(red(`prettier failed, check logs above. ${displayTook()}`))
351352
process.exit(prettierCode.status)
352353
}
353354
}
354355

355356
spinner.prefixText = bgGreen(` kitql-lint `)
356357
spinner.succeed(
357-
`All good, ${glob === '' ? 'nothing to do!' : filesLength !== -1 ? `your ${filesLength} files looks great!` : 'your files looks great!'} ${gray('(')}${took.join(gray(', '))}${gray(')')}`,
358+
`All good, ` +
359+
`${glob === '' ? 'nothing to do!' : filesLength !== -1 ? `your ${filesLength} files looks great!` : 'your files looks great!'} ` +
360+
displayTook(),
358361
)
359362
spinner.stop()
360363
process.exit(0)

0 commit comments

Comments
 (0)