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).
backend ruleP2universalStack: TypeScript
importslintingreadability
Import named members directly instead of suppressing a lint rule
Destructure the named export at import time (e.g. import x, { y } from 'pkg') rather than accessing default.member and adding a disable comment.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | import formidable from 'formidable'; |
| 2 | // oxlint-disable-next-line import/no-named-as-default-member |
| 3 | if (error.code === formidable.errors.biggerThanMaxFileSize) {} |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | import formidable, { errors } from 'formidable'; |
| 2 | if (error.code === errors.biggerThanMaxFileSize) {} |
Explanation (EN)
Objašnjenje (HR)