Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: suppress warnings when using --quiet #1355

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -108,7 +108,7 @@ export const runAll = async (
// Lint-staged will create a backup stash only when there's an initial commit,
// and when using the default list of staged files by default
ctx.shouldBackup = hasInitialCommit && stash
if (!ctx.shouldBackup) {
if (!ctx.shouldBackup && !quiet) {
logger.warn(skippingBackup(hasInitialCommit, diff))
}

Expand Down Expand Up @@ -242,7 +242,7 @@ export const runAll = async (
}
}

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

Expand Down