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
importsreadabilityconventionsorganization
Separate external dependencies from local imports with a blank line
Group third-party imports first, then a blank line, then internal/local imports, so it is easy to see what the module actually depends on.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | import { Component } from 'preact'; |
| 2 | import { Article } from 'view/component/Article'; |
| 3 | import classNames from 'classnames'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | import classNames from 'classnames'; |
| 2 | import { Component } from 'preact'; |
| 3 |
|
| 4 | import { Article } from 'view/component/Article'; |
Explanation (EN)
Objašnjenje (HR)