Skip to content

chore(tooling): add pre-commit prettier hook and consolidate prettier devDependency#334

Merged
robingenz merged 1 commit into
mainfrom
chore/pre-commit-prettier-hook
May 25, 2026
Merged

chore(tooling): add pre-commit prettier hook and consolidate prettier devDependency#334
robingenz merged 1 commit into
mainfrom
chore/pre-commit-prettier-hook

Conversation

@robingenz
Copy link
Copy Markdown
Member

Summary

  • Add husky + lint-staged so staged **/*.{css,html,ts,js,java} files are auto-formatted with the workspace-pinned prettier on every commit. Makes it physically impossible to push prettier-dirty code without --no-verify.
  • Move prettier@3.4.2 from every packages/*/package.json into the root package.json devDependencies (single source of truth). Per-package npm run prettier scripts continue to work via npm workspace hoisting.
  • Add "prepare": "husky" so npm install wires up the hook automatically.
  • Bump CI NODE_VERSION from 20 to 24 to match the release workflow.

prettier-plugin-java duplication is left alone (already consistent — hoisted at root and listed in each package).

Mirrors capawesome-team/capacitor-firebase#995.

Test plan

  • npm install runs cleanly and triggers prepare → husky wires up core.hooksPath=.husky/_
  • Per-package npm run prettier still resolves prettier via workspace hoist (verified via packages/barcode-scanning)
  • Commit with no matching staged files short-circuits cleanly (lint-staged could not find any staged files matching configured tasks)

… devDependency

- Add husky + lint-staged so staged **/*.{css,html,ts,js,java} files are auto-formatted with the workspace-pinned prettier on every commit.
- Move prettier@3.4.2 from every packages/*/package.json into the root package.json devDependencies (single source of truth). Per-package npm run prettier scripts continue to work via npm workspace hoisting.
- Add "prepare": "husky" so npm install wires up the hook automatically.
- Bump CI NODE_VERSION from 20 to 24 to match the release workflow.

Mirrors capawesome-team/capacitor-firebase#995.
Copilot AI review requested due to automatic review settings May 25, 2026 14:23
Copy link
Copy Markdown

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 updates repository tooling to enforce consistent Prettier formatting at commit-time across the npm workspaces, while centralizing the Prettier dependency at the repo root and aligning CI with the expected Node.js version.

Changes:

  • Add Husky + lint-staged and configure a pre-commit hook to auto-run Prettier on staged files.
  • Consolidate prettier@3.4.2 into the root package.json (removing per-package Prettier devDependencies).
  • Bump CI Node.js version from 20 to 24.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/translation/package.json Removes per-package prettier devDependency to rely on workspace-hoisted Prettier.
packages/subject-segmentation/package.json Removes per-package prettier devDependency to rely on workspace-hoisted Prettier.
packages/selfie-segmentation/package.json Removes per-package prettier devDependency to rely on workspace-hoisted Prettier.
packages/face-mesh-detection/package.json Removes per-package prettier devDependency to rely on workspace-hoisted Prettier.
packages/face-detection/package.json Removes per-package prettier devDependency to rely on workspace-hoisted Prettier.
packages/document-scanner/package.json Removes per-package prettier devDependency to rely on workspace-hoisted Prettier.
packages/barcode-scanning/package.json Removes per-package prettier devDependency to rely on workspace-hoisted Prettier.
package.json Adds Husky/lint-staged + root Prettier and configures prepare + lint-staged tasks.
package-lock.json Updates lockfile for new devDeps and reflects workspace dependency graph changes.
.husky/pre-commit Adds pre-commit hook invoking lint-staged.
.github/workflows/ci.yml Updates CI Node.js version to 24.

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

Comment thread .husky/pre-commit
Comment thread package.json
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 25, 2026

Open in StackBlitz

@capacitor-mlkit/barcode-scanning

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/barcode-scanning@334

@capacitor-mlkit/document-scanner

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/document-scanner@334

@capacitor-mlkit/face-detection

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/face-detection@334

@capacitor-mlkit/face-mesh-detection

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/face-mesh-detection@334

@capacitor-mlkit/selfie-segmentation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/selfie-segmentation@334

@capacitor-mlkit/subject-segmentation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/subject-segmentation@334

@capacitor-mlkit/translation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/translation@334

commit: 19479cb

@robingenz robingenz merged commit 3ae4a74 into main May 25, 2026
7 checks passed
@robingenz robingenz deleted the chore/pre-commit-prettier-hook branch May 25, 2026 14:45
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