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 ruleP2universalStack: javascript
formattingreadabilityjsx
Break long lines and class expressions across multiple lines
When a JSX tag or className string exceeds the line-length limit, put each attribute or chained step on its own line or extract a variable; don't rely on the linter to have missed it.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | <button id={id} className={style.teaser} onClick={handleClick(event)} key={id} data-ga-label={index} data-ga4-event-details-1='open' data-ga4-link-title={event.name} data-ga4-link-url={url}> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | <button |
| 2 | id={id} |
| 3 | className={style.teaser} |
| 4 | onClick={handleClick(event)} |
| 5 | key={id} |
| 6 | data-ga4-event-details-1='open' |
| 7 | data-ga4-link-title={event.name} |
| 8 | > |
Explanation (EN)
Objašnjenje (HR)