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).
A lint, format, or test command you introduce must pass on a clean checkout
Switching linters or formatters surfaces findings the old tool never reported, so verify the new command from a fresh clone before merging - otherwise every teammate meets it as a failure and a blocked commit hook.
Bad example
| 1 | // package.json - the new command is added, but never run from a clean checkout |
| 2 | { "scripts": { "lint": "oxlint" } } |
| 3 |
|
| 4 | $ pnpm lint |
| 5 | sse-stress.js:26:17 error unicorn(no-new-array) |
| 6 | ... 4 errors -> and the new pre-commit hook now blocks that file |
Explanation (EN)
The tool's recommended set differs from the previous one, so the command the change introduces is failing the moment it lands and blocks unrelated commits.
Objašnjenje (HR)
Preporuceni skup novog alata razlikuje se od prethodnog, pa naredba koju promjena uvodi pada cim se spoji i blokira nepovezane commitove.
Good example
| 1 | // Either fix the findings, or scope the tool away from throwaway files: |
| 2 | // .oxlintrc.json |
| 3 | { "ignorePatterns": ["dist/**", ".zed/**", "sse-stress.js"] } |
| 4 |
|
| 5 | $ pnpm lint |
| 6 | Found 0 warnings and 0 errors. |
Explanation (EN)
The command is green on the branch, so the hook it powers only ever blocks genuine regressions.
Objašnjenje (HR)
Naredba je zelena na grani, pa hook koji ona pokrece blokira samo stvarne regresije.
Notes (EN)
Run the full command, not just the staged-file subset the hook runs. A tool migration is also the moment to decide which throwaway scripts are out of scope.
Bilješke (HR)
Pokreni punu naredbu, a ne samo podskup datoteka koji pokrece hook. Migracija alata je i trenutak za odluku koje su pomocne skripte izvan opsega.