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).
frontend ruleP2stack specificStack: react
reactclean-codereadabilityjsx
Inline a className that is only ever a single constant class
Don't introduce a local variable to hold a className that never varies; reference the class directly in the element.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | const containerClass = css.container; |
| 2 | return <div className={containerClass}>...</div>; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | return <div className={css.container}>...</div>; |
Explanation (EN)
Objašnjenje (HR)