Skip to content

Conversation

@Xe
Copy link
Contributor

@Xe Xe commented Sep 3, 2025

Executive summary:

  • Added husky and lint-staged devDependencies and config in package.json.
  • Added npm scripts: "lint-staged" and "prepare" to ensure husky is installed.
  • Created .husky/pre-commit to run npx lint-staged on commit, which runs Prettier on staged .md/.mdx/.js/.jsx/.ts/.tsx files.

Made-with-help-from: GitHub Copilot

@Xe Xe requested a review from katieschilling September 3, 2025 14:53
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR introduces automated code formatting on commit by integrating husky and lint-staged into the Tigris OS documentation project. The changes add:

  1. Husky and lint-staged dependencies - These are development tools that work together to run linters/formatters on Git hooks
  2. npm scripts - A "prepare" script that automatically installs husky hooks after npm install, and a "lint-staged" script for manual execution
  3. Pre-commit hook - A simple .husky/pre-commit file that executes npx lint-staged before each commit
  4. lint-staged configuration - Targets staged .md, .mdx, .js, .jsx, .ts, and .tsx files to run Prettier formatting

This implementation follows standard industry practices for maintaining consistent code style in JavaScript/TypeScript projects. The setup ensures that any staged files matching the specified extensions are automatically formatted with Prettier before being committed, eliminating manual formatting inconsistencies across the team. The configuration is particularly well-suited for a documentation project like this one, which contains a mix of markdown files for docs and JavaScript/TypeScript files for the Docusaurus site functionality.

The integration fits seamlessly with the existing project structure, which already uses Prettier (as evidenced by the .prettierrc configuration file) and follows modern JavaScript tooling conventions.

Confidence score: 5/5

  • This PR is extremely safe to merge with virtually no risk of issues
  • Score reflects the standard, well-established tooling with minimal complexity and no breaking changes
  • No files require special attention as this is a straightforward tooling addition

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@vercel
Copy link

vercel bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-redirect Ready Ready Preview Comment Sep 3, 2025 3:10pm
tigris-os-docs Ready Ready Preview Comment Sep 3, 2025 3:10pm

Executive summary:
- Added husky and lint-staged devDependencies and config in package.json.
- Added npm scripts: "lint-staged" and "prepare" to ensure husky is installed.
- Created .husky/pre-commit to run `npx lint-staged` on commit, which runs Prettier on staged .md/.mdx/.js/.jsx/.ts/.tsx files.

Made-with-help-from: GitHub Copilot
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.

2 participants