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
lintingcode-qualityrefactoring
Refactor instead of suppressing lint with disable comments
Prefer extracting JSX/logic into a named function or component over sprinkling lint-disable comments (jsx-no-multiline-js, max-line-length, no-important); a disable comment is the last resort, not the fix.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | {/* tslint:disable-next-line: jsx-no-multiline-js */} |
| 2 | <p>{longExpressionInline}</p> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | const Description = () => <p>{longExpression}</p>; |
| 2 | <Description /> |
Explanation (EN)
Objašnjenje (HR)