Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Use Node.js LTS and plan safe upgrades
Run the latest Node LTS and roll upgrades through smoke tests before production.
Bad example
| 1 | // package.json |
| 2 | { |
| 3 | "engines": { "node": "*" }, |
| 4 | "scripts": { |
| 5 | "start": "node server.js" |
| 6 | } |
| 7 | } |
Explanation (EN)
Not pinning a supported runtime makes deployments inconsistent across machines and increases the chance of breaking changes hitting production unexpectedly.
Objašnjenje (HR)
Ako ne definiraš podržanu verziju runtime-a, deployment može biti različit po okruženjima i veća je šansa da te breaking promjene pogode u produkciji.
Good example
| 1 | // package.json |
| 2 | { |
| 3 | "engines": { "node": ">=20 <21" }, |
| 4 | "scripts": { |
| 5 | "smoke": "node ./scripts/smoke.js", |
| 6 | "start": "node server.js" |
| 7 | } |
| 8 | } |
Explanation (EN)
Using a specific LTS range makes environments predictable. A smoke test script gives you a fast safety net before rolling out runtime updates.
Objašnjenje (HR)
Korištenje konkretnog LTS raspona čini okruženja predvidljivima. Smoke test daje brzu sigurnosnu mrežu prije puštanja runtime updatea.