Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP2stack specificStack: node
toolingpackage-jsonoverheadyagni
Do not add scripts whose only purpose is catching another developer's tooling mistake
Avoid install/preinstall guard scripts that exist only to catch a wrong-package-manager mistake; the cost outweighs the rare one-time error.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codejson
| 1 | { |
| 2 | "scripts": { |
| 3 | "preinstall": "npx only-allow pnpm" |
| 4 | } |
| 5 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejson
| 1 | { |
| 2 | "scripts": { |
| 3 | "build": "..." |
| 4 | } |
| 5 | // Rely on the lockfile / engines field; a one-time wrong-PM mistake self-corrects. |
| 6 | } |
Explanation (EN)
Objašnjenje (HR)