Why this matters
Keeps types and runtime in sync, reducing drift.
Avoid duplicating runtime schemas and TypeScript types; derive types from constants/functions or declare as const tuples.
Keeps types and runtime in sync, reducing drift.
Side-by-side examples engineers can pattern-match during review.
type Status = 'syncing'|'synced'|'error'; const STATUSES=['syncing','synced','error'];const STATUSES = ['syncing','synced','error'] as const; type Status = typeof STATUSES[number];type X='a'|'b'; const ARR=['a','b']const ARR=['a','b'] as const; type X=typeof ARR[number]From the same buckets as this rule.