Skip to content

Commit

Permalink
fix: suppress warnings when using --quiet
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Nov 11, 2023
1 parent 21aeeb5 commit 3aa738c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/mighty-ducks-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'lint-staged': patch
---

Suppress some warnings when using the "--quiet" flag
4 changes: 2 additions & 2 deletions lib/runAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const runAll = async (
// and when using the default list of staged files by default
ctx.shouldBackup = hasInitialCommit && stash
if (!ctx.shouldBackup) {
logger.warn(skippingBackup(hasInitialCommit, diff))
if (!quiet) logger.warn(skippingBackup(hasInitialCommit, diff))
}

const files = await getStagedFiles({ cwd: gitDir, diff, diffFilter })
Expand Down Expand Up @@ -243,7 +243,7 @@ export const runAll = async (
}

if (hasDeprecatedGitAdd) {
logger.warn(DEPRECATED_GIT_ADD)
if (!quiet) logger.warn(DEPRECATED_GIT_ADD)
}

// If all of the configured tasks should be skipped
Expand Down

0 comments on commit 3aa738c

Please sign in to comment.