Skip to content

Conversation

@sestinj
Copy link
Contributor

@sestinj sestinj commented Sep 25, 2025

Description

add a pre-commit hook to run husky


Summary by cubic

Set up a Husky pre-commit hook with lint-staged so Prettier formats staged files automatically. Also expanded .prettierignore to skip generated VSCode e2e outputs and other build folders.

  • Dependencies

    • Added husky (^9.1.7) and lint-staged (^15.5.2).
  • Migration

    • Run npm install to install hooks (prepare script is included).
    • If hooks don’t run, execute npm run prepare.

@sestinj sestinj requested a review from a team as a code owner September 25, 2025 19:31
@sestinj sestinj requested review from tingwai and removed request for a team September 25, 2025 19:31
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 25, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 4 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name=".husky/pre-commit">

<violation number="1" location=".husky/pre-commit:1">
Use npx with --no-install to avoid network installs and ensure deterministic hook behavior.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@@ -0,0 +1 @@
npx lint-staged
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 25, 2025

Choose a reason for hiding this comment

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

Use npx with --no-install to avoid network installs and ensure deterministic hook behavior.

Prompt for AI agents
Address the following comment on .husky/pre-commit at line 1:

<comment>Use npx with --no-install to avoid network installs and ensure deterministic hook behavior.</comment>

<file context>
@@ -0,0 +1 @@
+npx lint-staged
</file context>

✅ Addressed in 352d53c

@RomneyDa
Copy link
Collaborator

We did this at some point and removed because the husky job takes like 30 seconds on any commit and logs a bunch, as opposed to the targeted format by format on save. Just double checking that this will be quick and targeted?

@sestinj
Copy link
Contributor Author

sestinj commented Sep 25, 2025

yeah the command here only formats staged files, I tried it and it took 1-2 seconds

@sestinj sestinj merged commit 418dd12 into main Sep 25, 2025
41 of 42 checks passed
@sestinj sestinj deleted the nate/husky branch September 25, 2025 23:13
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Sep 25, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2025
@github-actions github-actions bot added the tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys label Sep 25, 2025
@sestinj
Copy link
Contributor Author

sestinj commented Sep 26, 2025

🎉 This PR is included in version 1.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor Author

sestinj commented Oct 1, 2025

🎉 This PR is included in version 1.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

released size:S This PR changes 10-29 lines, ignoring generated files. tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants