ci: add Prettier and CSpell linting via git hooks and CI#201
Merged
Conversation
Wire up Prettier and CSpell linting for the template, enforced both locally via the config-based pre-commit hook and in CI on every PR. - .githooks/pre-commit: Prettier --check on staged Markdown/JSON/JSON5/ YAML and CSpell on staged Markdown, invoked via [hook "linter"] - .cspell.json: switch to "unknownWords": "report-common-typos" - .github/workflows/lint.yml: new Lint workflow running the same checks on Node 24 with SHA-pinned actions - .github/renovate.json: custom.regex manager keeps the prettier/cspell pins in the hook and workflow in sync, grouped as "lint tooling" - README.md: document the hook, CI check, and local enablement
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the new Prettier + CSpell linting setup: the config-based pre-commit hook ( Code Review DetailsNo findings. |
theMickster
approved these changes
Jul 1, 2026
withinfocus
added a commit
to bitwarden/contributing-docs
that referenced
this pull request
Jul 1, 2026
…827) The Local linting section described Husky + lint-staged installed via npm, which no longer exists in the template repo. Rewrite it to match bitwarden/template#201: a pre-commit git hook and matching CI lint workflow running Prettier and CSpell over Markdown and config files, with repos expected to add linters for their own languages. Rename the heading to Linting since it now covers CI as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
No associated Jira ticket — repository tooling change.
📔 Objective
Wire up Prettier and CSpell linting for the template repo, enforced both locally (pre-commit git hook) and in CI on every pull request.
.githooks/pre-commit— runs Prettier (--check) on staged Markdown/JSON/JSON5/YAML and CSpell on staged Markdown. Invoked through the existing config-based[hook "linter"]in.gitconfig; enable per clone withgit config set --local include.path "../.gitconfig"..cspell.json— switched to"unknownWords": "report-common-typos"so only common typos (not every proper noun) are flagged, mirroring bitwarden/tech-breakdowns#17..github/workflows/lint.yml— new Lint workflow running the same Prettier + CSpell checks on every PR, on Node 24 (LTS), with SHA-pinnedactions/checkoutv7.0.0 andactions/setup-nodev6.4.0. A comment notes it must mirror the git hook..github/renovate.json— added acustom.regexmanager that keeps the pinnedprettier@/cspell@versions in the hook and the workflow in sync, grouped as a single "lint tooling" PR.README.md— documents the hook, the CI check, and how to enable hooks locally.Tool versions are pinned and identical across the hook and workflow (
prettier@3.9.1,cspell@10.0.1); Renovate bumps them together.