Skip to content

Conversation

@syedali237
Copy link
Contributor

Related Tickets & Documents

Fixes: #3506

Description

  • This PR adds a fast, reliable pre-commit workflow so commits don’t slip in with lint/format issues.

Changes

  • Adds Husky pre-commit hook to run staged files only during commit.
  • Add Prettier + Tailwind plugin for consistent formatting
  • Add configuration files for lint-staged and Prettier

Type of Change

  • Chore (maintenance, refactoring, tooling updates)
  • Bug fix (non-breaking change that fixes an issue)
  • New feature (change that adds functionality)
  • Breaking Change (may require updates in existing code)
  • UI improvement (visual or design changes)
  • Performance improvement (optimization or efficiency enhancements)
  • Documentation update (changes to README, guides, etc.)
  • CI (updates to continuous integration workflows)
  • Revert (undo a previous commit or merge)

Testing

  • npx lint-staged (verified it runs; requires staged files to do work)
  • Ensure the build is successful after npm run build.
Screenshot 2026-01-14 at 4 44 27 PM

Demo

Screenshot 2026-01-14 at 4 14 44 PM

Environment and Dependencies

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added corresponding tests
  • I have run the build command to ensure there are no build errors
  • [ ] My changes have been tested across relevant browsers/devices
  • For UI changes, I've included visual evidence of my changes

Signed-off-by: Syed Ali Ul Hasan <syedaliulhasan19@gmail.com>
Copilot AI review requested due to automatic review settings January 14, 2026 11:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR sets up automated code quality checks on commit using Husky and lint-staged, ensuring consistent formatting and linting before changes are committed.

Changes:

  • Added Husky pre-commit hook that runs lint-staged on staged files only
  • Configured Prettier with Tailwind plugin for consistent code formatting
  • Added new npm scripts for linting, formatting, and type checking

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Added new dependencies (husky, lint-staged, prettier, prettier-plugin-tailwindcss) and npm scripts for formatting, linting, and pre-commit hooks
lint-staged.config.cjs Configured lint-staged to run ESLint and Prettier on staged files based on file type
.prettierrc.json Configured Prettier with single quotes, trailing commas, 100 character line width, and Tailwind plugin
.prettierignore Specified files and directories to exclude from Prettier formatting
.husky/pre-commit Created Husky pre-commit hook that runs the precommit npm script

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Syed Ali Ul Hasan <syedaliulhasan19@gmail.com>
@syedali237
Copy link
Contributor Author

@amaan-bhati I haven’t added npm run format to the pre-commit hook yet, since it would introduce many changes in one PR. I will open a separate PR for formatting.

Screenshot 2026-01-14 at 4 50 31 PM

@syedali237 syedali237 requested a review from Copilot January 14, 2026 11:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant