Skip to content

Conversation

@CodexRaunak
Copy link
Contributor

@CodexRaunak CodexRaunak commented Jan 6, 2026

Description

This PR fixes #7325

Notes for Reviewers

  • Update pre commit hook to lint only staged files
  • Remove the below as they are deprecated
husky install in prepare script
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

Signed commits

  • Yes, I signed my commits.

@l5io
Copy link
Contributor

l5io commented Jan 6, 2026

🚀 Preview for commit c58a322 at: https://695d8bc2aaec2abb0550c9fc--layer5.netlify.app

@l5io
Copy link
Contributor

l5io commented Jan 9, 2026

🚀 Preview for commit 4bd11dc at: https://696141381db43028a2cdeca5--layer5.netlify.app

@l5io
Copy link
Contributor

l5io commented Jan 11, 2026

🚀 Preview for commit b625e2a at: https://696435b79b1d4bd76d83b7ab--layer5.netlify.app

@Rajesh-Nagarajan-11
Copy link
Member

So, whenever a commit is made, the staged files are automatically linted and fixed before the commit is completed?

@l5io
Copy link
Contributor

l5io commented Jan 14, 2026

🚀 Preview for commit c18ac0b at: https://6967e59ce4e5d9a657e3aa99--layer5.netlify.app

@CodexRaunak
Copy link
Contributor Author

So, whenever a commit is made, the staged files are automatically linted and fixed before the commit is completed?

Exactly

@l5io
Copy link
Contributor

l5io commented Jan 15, 2026

🚀 Preview for commit 3bf66f7 at: https://69685a5ba315d25d2770e85e--layer5.netlify.app

Comment on lines +1 to +11
module.exports = {
// Lint & Prettify TS and JS files - only the staged files
"**/*.(ts|tsx|js|jsx)": (filenames) => [
`cross-env NODE_ENV=test npx eslint --fix --max-warnings=0 ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
`npx prettier --write ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
],

// Prettify only Markdown and JSON files
"**/*.(md|json)": (filenames) =>
`npx prettier --write ${filenames.map((f) => `'${f.replace(/'/g, "'\\''")}'`).join(" ")}`,
};

Choose a reason for hiding this comment

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

@CodexRaunak I think this file is over-engineered because some lint-staged already:

  • Passes staged filenames automatically
  • Handles spaces safely

And I have question why you're using npx why not npm run lint which already point to eslint --fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove install tag from prepare scripts

6 participants