balligh-insage/claida-type-fest-rules icon
public
Published on 3/6/2025
balligh-insage/claida-type-fest-rules

Rules
  • Require TypeScript 5.1+ with "strict": true.
  • Avoid the any type; prefer type-fest utility types for safer type definitions.
  • Use descriptive, complete naming (e.g., filteredUsers, hasError); avoid abbreviations.
  • Keep functions short and focused; create helper types for repeated patterns.
  • Export a single main entity per file (e.g., types, helpers).
  • Prefer Except<T, K> over built-in Omit when stricter key omission is needed.
  • Use Merge or MergeDeep to combine types without losing properties.
  • Rely on PartialDeep and RequiredDeep for deeply nested optional or required transformations.
  • Favor ReadonlyDeep to ensure immutability in deeply nested structures.
  • For brand-like types, use Tagged to create and UnwrapTagged to extract the underlying value.
  • Wrap large utility expressions in meaningful type aliases for clarity.