We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
?.
1 parent eae9622 commit 5f0a6a7Copy full SHA for 5f0a6a7
lib/index.js
@@ -109,7 +109,7 @@ const lintStaged = async (
109
printTaskOutput(ctx, logger)
110
return true
111
} catch (runAllError) {
112
- if (runAllError && runAllError.ctx && runAllError.ctx.errors) {
+ if (runAllError?.ctx?.errors) {
113
const { ctx } = runAllError
114
115
if (ctx.errors.has(ConfigNotFoundError)) {
lib/printTaskOutput.js
@@ -5,7 +5,7 @@
5
*/
6
export const printTaskOutput = (ctx = {}, logger) => {
7
if (!Array.isArray(ctx.output)) return
8
- const log = ctx.errors && ctx.errors.size > 0 ? logger.error : logger.log
+ const log = ctx.errors?.size > 0 ? logger.error : logger.log
9
for (const line of ctx.output) {
10
log(line)
11
}
0 commit comments