-
Notifications
You must be signed in to change notification settings - Fork 7
Add .npmrc with security hardening settings #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ignore-scripts=true | ||
| save-exact=true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Consider updating the existing entries in
Comment on lines
+1
to
+2
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical Issue: Setting
ignore-scripts=truewill break the existingpreparescript ("prepare": "husky install"inpackage.json). When any contributor runsnpm install, Husky will no longer be set up automatically, meaning the pre-push lint hook (.husky/pre-push) won't be installed and will silently stop working.The PR description mentions using a per-package allowlist (
lifecycle-script-allowed[]=<pkg>) as a workaround, but that syntax is not supported by standard npm — it is specific to pnpm. For npm, there is no built-in per-package script allowlist.Practical options to resolve this:
ignore-scripts=trueand rely onpackage-lock.jsonintegrity +npm auditfor supply chain defense instead.preparewith a manual step: Remove thepreparescript and document that contributors must runnpx husky installonce after cloning. Update the README accordingly..husky-aware workaround: Keep the setting but add a note in the README and CI configuration reminding contributors/CI to runnpm run prepareexplicitly afternpm install --ignore-scripts.