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).
fullstack ruleP2stack specificStack: typescript
typescriptsuppressionsmaintainabilitylinting
Prefer @ts-expect-error over @ts-ignore for suppressions
Use @ts-expect-error so the compiler flags the suppression once the underlying error is fixed, instead of @ts-ignore which silently lingers.
PR: hegnar-forum-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codets
| 1 | // @ts-ignore |
| 2 | const x = legacyApi(); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | // @ts-expect-error legacyApi has no types yet |
| 2 | const x = legacyApi(); |
Explanation (EN)
Objašnjenje (HR)