Skip to content

Conversation

@omjikush09
Copy link

@omjikush09 omjikush09 commented Sep 22, 2025

Added pre commit hook for staged file
Issue #125


Important

Adds a pre-commit hook using Husky to run lint-staged on staged files in the frontend directory, ensuring linting and formatting before commits.

  • Pre-commit Hook:
    • Adds .husky/pre-commit to run lint-staged on staged files in the frontend directory.
  • Package Configuration:
    • Updates package.json to include a prepare script for Husky setup.
    • Adds lint-staged configuration to package.json for *.{ts,tsx,mdx} files to run next lint --file and prettier --write.

This description was created by Ellipsis for d8b93e6. You can customize this summary. It will automatically update as commits are pushed.

@CLAassistant
Copy link

CLAassistant commented Sep 22, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to d8b93e6 in 2 minutes and 13 seconds. Click for details.
  • Reviewed 34 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/package.json:16
  • Draft comment:
    Consider using 'husky install frontend/.husky' (rather than 'husky frontend/.husky') and avoid '|| true' to prevent masking installation errors.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The comment appears to be technically correct - 'husky install' is indeed the proper command according to husky's documentation, and '|| true' could mask installation errors. However, this is a dependency/setup related comment, and our rules explicitly state not to comment on dependency-related issues. Even though the suggestion is valid, it falls outside our review scope. The comment is technically accurate and could prevent potential issues with git hook installation. Am I being too strict with the dependency rule? No - the rules clearly state "Do NOT comment on dependency changes... or anything else related to dependencies." Husky is a dev dependency used for git hooks setup, so this falls squarely under that rule. While the comment makes a valid technical suggestion, it violates our rule about not commenting on dependency-related matters, so it should be removed.
2. frontend/package.json:176
  • Draft comment:
    Add a newline at the end of the file for consistency.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 30% <= threshold 50% The comment is asking for a newline at the end of the file, which is a common style guide requirement for consistency across files. However, it doesn't provide a specific code suggestion or address a potential issue with the code's functionality. It seems to be more of a stylistic preference rather than a necessary change for the code to function correctly.

Workflow ID: wflow_B9I05dU3gDh18ux6

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

"typescript": "5.8.3"
},
"lint-staged": {
"*.{ts,tsx,mdx}": ["next lint --file","prettier --write"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure 'next lint --file' correctly receives staged filenames—adding an explicit placeholder might be beneficial.

Suggested change
"*.{ts,tsx,mdx}": ["next lint --file","prettier --write"]
"*.{ts,tsx,mdx}": ["next lint --file --", "prettier --write"]

@skull8888888
Copy link
Member

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@omjikush09 omjikush09 force-pushed the omji/add-precommit-hook branch from 45050e0 to 2689683 Compare September 22, 2025 16:51
@omjikush09 omjikush09 force-pushed the omji/add-precommit-hook branch from 9b2cee0 to 5c7e284 Compare September 22, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants