What problem does it solve?
LobeHub’s TypeScript codebase can degrade over time without consistent type-safety practices, leading to unsafe casts, untyped values, brittle APIs, and harder-to-debug runtime issues.
Core Features & Use Cases
- Type safety conventions: prefer well-scoped
type/interface, use Record<PropertyKey, unknown> instead of any/object, and apply as const satisfies for safer literal typing.
- Error-handling and safety: use
@ts-expect-error instead of suppressing with @ts-ignore, and avoid silent fallbacks via .catch(() => fallback).
- Maintainable architecture patterns: favor ES module augmentation (
declare module) over namespace, and design extensible metadata patterns alongside the code that consumes/produces them (e.g., PipelineContext.metadata).
- Team-wide consistency: standardize import rules (separate type imports), concurrency with
Promise.all, and code structure preferences that improve readability and reduce refactor drift.
Quick Start
Ask an AI to review a changed .ts or .tsx file and flag any violations of LobeHub’s TypeScript type-safety, import, and error-handling rules.