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
namingimportsmaintainability
Rename a symbol at its definition rather than aliasing at each import
If a component or function has a misleading name, rename it where it is defined instead of aliasing it on every import.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | import { CopyIcon as CopyToClipboard } from './CopyIcon'; |
| 2 | import { CopyIcon as CopyToClipboard } from './CopyIcon'; // repeated alias everywhere |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // Rename the export once at the source |
| 2 | export const CopyToClipboard = () => { /* ... */ }; |
| 3 |
|
| 4 | // Then import it plainly |
| 5 | import { CopyToClipboard } from './CopyToClipboard'; |
Explanation (EN)
Objašnjenje (HR)