ci: add prettier PR check and pre-commit formatting - #12
Merged
Conversation
Formatting was previously unenforced: the repo ships a prettier config but nothing ran it. This wires up enforcement without changing the config. - add husky + lint-staged pre-commit: formats staged files into the same commit - add a PR check that runs the exact prettier version from package-lock.json against PR-changed files only - one-time cleanup of files that had drifted from the config - ignore package-lock.json: npm owns its formatting, and this repo's tab-based prettier config would fight every npm install Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- persist-credentials: false on checkout: nothing after it needs git credentials and npx executes downloaded code - accept only exact-semver prettier versions from the PR-controlled lockfile before handing them to npx - terminate prettier option parsing with -- so dash-prefixed filenames cannot be read as flags Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Xrazik1
approved these changes
Jul 13, 2026
n8n community-node lint forbids lifecycle scripts in the package (no-forbidden-lifecycle-scripts): they execute arbitrary code when the node installs into a user's n8n instance. Hooks become opt-in for contributors via `npm run hooks:install`; the PR prettier check remains the enforced gate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Description
Standardizes Prettier enforcement:
pr-prettier-check.ymlworkflow: on every PR, checks the files changed against the base branch using the exact Prettier version frompackage-lock.json. Installs only Prettier via npx instead of a fullnpm ci.prettierto an exact version. Prettier ships formatting changes in minor releases, so a version range can drift contributors against CI..prettierignore.Client-side hooks are advisory - contributors who install with scripts disabled never get hooks - which is why the CI check is the enforcement layer.
🤖 Generated with Claude Code