@kitql/eslint-config 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cmd.js +12 -3
- package/package.json +1 -1
package/cmd.js
CHANGED
|
@@ -312,6 +312,7 @@ const took = []
|
|
|
312
312
|
const display = (text, time) => {
|
|
313
313
|
return `${gray(text)} ${green((time / 1000).toFixed(3))}${gray('s')}`
|
|
314
314
|
}
|
|
315
|
+
const displayTook = () => `${gray('(')}${took.join(gray(', '))}${gray(')')}`
|
|
315
316
|
|
|
316
317
|
// If changed-only flag is set, get the list of changed files
|
|
317
318
|
if (diffOnly) {
|
|
@@ -335,7 +336,7 @@ if (!prettierOnly && glob) {
|
|
|
335
336
|
took.push(display('eslint', esLintTook))
|
|
336
337
|
if (eslintCode.status) {
|
|
337
338
|
spinner.prefixText = bgRedBright(` kitql-lint `)
|
|
338
|
-
spinner.fail(red(`eslint failed, check logs above
|
|
339
|
+
spinner.fail(red(`eslint failed, check logs above. ${displayTook()}`))
|
|
339
340
|
process.exit(eslintCode.status)
|
|
340
341
|
}
|
|
341
342
|
}
|
|
@@ -347,14 +348,22 @@ if (!eslintOnly && glob) {
|
|
|
347
348
|
took.push(display('prettier', prettierTook))
|
|
348
349
|
if (prettierCode.status) {
|
|
349
350
|
spinner.prefixText = bgRedBright(` kitql-lint `)
|
|
350
|
-
spinner.fail(red(`prettier failed, check logs above
|
|
351
|
+
spinner.fail(red(`prettier failed, check logs above. ${displayTook()}`))
|
|
351
352
|
process.exit(prettierCode.status)
|
|
352
353
|
}
|
|
353
354
|
}
|
|
354
355
|
|
|
355
356
|
spinner.prefixText = bgGreen(` kitql-lint `)
|
|
356
357
|
spinner.succeed(
|
|
357
|
-
`All good,
|
|
358
|
+
`All good, ` +
|
|
359
|
+
`${
|
|
360
|
+
glob === ''
|
|
361
|
+
? 'nothing to do!'
|
|
362
|
+
: filesLength !== -1
|
|
363
|
+
? `your ${filesLength === 1 ? 'single file' : `${filesLength} files`} looks great!`
|
|
364
|
+
: 'your files looks great!'
|
|
365
|
+
} ` +
|
|
366
|
+
displayTook(),
|
|
358
367
|
)
|
|
359
368
|
spinner.stop()
|
|
360
369
|
process.exit(0)
|