Skip to content

Configure Husky and lint-staged for pre-commit hooks and workflows - #555

Merged
jliermann merged 7 commits into
mainfrom
husky
Oct 27, 2026
Merged

jliermann merged 7 commits into
mainfrom
husky

Conversation

@jliermann

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements to the project's automation and code quality workflows. The main changes are the addition of automated formatting and commit workflows for pull requests, refactoring of existing GitHub Actions for better reusability, and the integration of pre-commit hooks for local development. These updates aim to streamline the development process, enforce consistent code style, and reduce manual intervention for formatting fixes.

GitHub Actions and Workflow Improvements:

  • Added a reusable composite action (.github/actions/setup-node-env) that sets up the Node.js environment and checks out the repository, replacing repeated boilerplate in multiple workflows. The action now supports specifying a branch, tag, or SHA to check out via the ref input. [1] [2] [3] [4] [5]

  • Refactored the pr-check.yml and localisation.yml workflows to use the new setup-node-env action, reducing duplication and simplifying maintenance. [1] [2] [3] [4]

Automated Formatting and Commit Workflow:

  • Enhanced the formatting check in pr-check.yml to automatically apply Prettier fixes to changed files in pull requests targeting the main repository. If formatting changes are needed, a patch is uploaded and a new job (format-fix-commit) checks out the PR branch, applies the patch, commits the changes, and pushes them back using a GitHub App token. [1] [2]

Developer Experience and Local Tooling:

  • Added husky and lint-staged to enforce code quality before commits. The prepare script in package.json sets up Husky, and a pre-commit hook runs tests and lint-staged formatting. The lint-staged configuration ensures Prettier formats relevant files before committing. [1] [2] [3] [4]

Dependency Updates:

  • Updated typescript-eslint to the latest patch version.

@jliermann
jliermann merged commit b10d979 into main Oct 27, 2026
6 checks passed
@jliermann
jliermann deleted the husky branch October 27, 2026 17:38
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