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: react
architectureorganizationseparation-of-concerns
Keep non-rendering logic classes out of the view/component layer
A plain class with no JSX output is a helper, not a component; place it in a helpers/utils module.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | // src/common/component/WithTouchScreenDetector/index.tsx |
| 2 | export default class TouchDetector { isTouch(): boolean { /* no JSX */ } } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // src/common/helper/TouchDetector.ts |
| 2 | export default class TouchDetector { isTouch(): boolean { /* ... */ } } |
Explanation (EN)
Objašnjenje (HR)