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).
Comment your own code, not third-party library behavior
Don't restate how a library works in comments; document only what's non-obvious about your usage.
Bad example
| 1 | server: { |
| 2 | port: PORT, |
| 3 | // Note: `server` only configures the dev server, it does not affect |
| 4 | // the production build or the preview server, which use their own config. |
| 5 | proxy: { '/api': API_BASE_URL }, |
| 6 | } |
Explanation (EN)
This explains how the framework's config keys work — that's the framework's documentation job, and the note rots when the library changes.
Objašnjenje (HR)
Ovo objasnjava kako rade konfiguracijski kljucevi frameworka — to je posao dokumentacije frameworka, a biljeska zastari kad se biblioteka promijeni.
Good example
| 1 | server: { |
| 2 | port: PORT, |
| 3 | // Proxy auth endpoints to API_BASE_URL so cookies resolve same-origin in dev. |
| 4 | proxy: { '/api': API_BASE_URL }, |
| 5 | } |
Explanation (EN)
Keep only the comment that explains a project-specific decision the reader couldn't infer from the library docs.
Objašnjenje (HR)
Zadrzi samo komentar koji objasnjava odluku specificnu za projekt, koju citatelj ne moze iscitati iz dokumentacije biblioteke.