Skip to content

Commit

Permalink
Merge pull request #21 from hendraaagil/fix/pre-commit
Browse files Browse the repository at this point in the history
fix: multiple husky print & prettier path
  • Loading branch information
nauvalazhar authored Feb 2, 2023
2 parents e37e8b5 + 64c6f5e commit ae260c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

if [ -t 2 ]; then
exec >/dev/tty 2>&1
fi

yarn lint-staged
5 changes: 3 additions & 2 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ module.exports = {
// Lint & Prettify JSX and JS files
"**/*.(jsx|js)": (filenames) => [
`yarn lint`,
`yarn prettier --write ${filenames.join(" ")}`,
`yarn prettier --write "${filenames.join('" "')}"`,
],

// Prettify only JSON files
"**/*.(json)": (filenames) => `yarn prettier --write ${filenames.join(" ")}`,
"**/*.(json)": (filenames) =>
`yarn prettier --write "${filenames.join('" "')}"`,
};

1 comment on commit ae260c8

@vercel
Copy link

@vercel vercel bot commented on ae260c8 Feb 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.