Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Prefer native composition over custom comment directives
Express build entry differences through ordinary imports or configuration before adding comment markers and a parser that contributors must learn and keep synchronized.
Bad example
| 1 | const excluded = readCommentDirectives('landing.scss', '// [entry] dropped:'); |
| 2 | assertEveryImportClassified('site.scss', 'landing.scss', excluded); |
Explanation (EN)
A second comment-based language and synchronization gate are introduced for a list of imports.
Objašnjenje (HR)
Za popis uvoza uvodi se drugi jezik u komentarima i posebna provjera sinkronizacije.
Good example
| 1 | import './base.css'; |
| 2 | import './landing.css'; |
Explanation (EN)
Native entry composition expresses what is included directly. Keep a plain separate import list if sharing would alter required ordering.
Objašnjenje (HR)
Sastavljanje ulaza običnim uvozima izravno pokazuje što je uključeno. Ostavi običan odvojen popis ako bi dijeljenje promijenilo potreban redoslijed.
Notes (EN)
Apply when a custom marker syntax exists only to mirror inclusion or exclusion already expressible by build entries. Prefer native composition or explicit ordinary configuration. Verify emitted CSS order, cascade and dependency behavior before extracting a shared stylesheet. Removing a custom protocol does not require forcing a shared file when order matters.
Bilješke (HR)
Primijeni kad prilagođene oznake služe samo za ponavljanje uključivanja ili isključivanja koje se već može izraziti ulazima za build. Prednost daj običnim uvozima ili izričitoj standardnoj konfiguraciji. Prije izdvajanja zajedničkog stila provjeri izlazni redoslijed CSS-a, kaskadu i ovisnosti. Uklanjanje posebnog protokola ne zahtijeva zajedničku datoteku kad je redoslijed bitan.
Exceptions / Tradeoffs (EN)
Documented directives required by an established compiler, generator or analysis tool remain valid. A custom protocol can be justified by a real capability gap, with clear semantics and tests. Do not delete necessary invariant coverage merely because it uses comments.
Iznimke / Tradeoffi (HR)
Dokumentirane direktive koje zahtijeva postojeći prevoditelj, generator ili alat za analizu ostaju valjane. Prilagođeni protokol može biti opravdan stvarnim nedostatkom mogućnosti, uz jasnu semantiku i testove. Nemoj ukloniti potrebne provjere samo zato što koriste komentare.