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: typescript
importsreadabilityconventions
Keep all import statements at the top of the file in canonical order
Imports belong grouped at the top of a module before any other code, with framework/library imports ordered consistently (e.g. React first). Scattered or out-of-order imports hurt readability and trip linters.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | import WidgetContainer from 'designSystem/cards/WidgetContainer'; |
| 2 | import React from 'react'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | import React from 'react'; |
| 2 |
|
| 3 | import WidgetContainer from 'designSystem/cards/WidgetContainer'; |
Explanation (EN)
Objašnjenje (HR)