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: javascript
browser-apinavigationclean-code
Use location.href for in-page navigation rather than window.open(_self)
For navigating the current tab, assign window.location.href instead of window.open with _self.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | window.open('/login', '_self'); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | window.location.href = '/login'; |
Explanation (EN)
Objašnjenje (HR)