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: typescript
testingvitestimportscleanliness
Don't import test helpers that are configured as globals
When the test runner exposes `describe`/`it`/`expect`/`vi` as globals, don't import them in each file; the import is redundant noise.
PR: hegnar-bellsheep-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | import { describe, expect, it, vi } from 'vitest'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // globals: true in config -> just use describe/it/expect/vi directly |
Explanation (EN)
Objašnjenje (HR)