← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

satisfies Operator (TS 4.9)

TypeScript 4.9 Intermediate
debt(d5/e1/b3/t7)
d5 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'specialist tool catches it' (d5). The detection_hints list only 'typescript' with automated: no, meaning the TypeScript compiler itself will catch misuse (e.g. using 'as' when 'satisfies' is appropriate) only if you're actively reviewing type errors. It won't flag that you chose 'as' over 'satisfies' as a lint warning by default — a developer must understand the distinction and look for it, placing it between a default linter catch and pure code review.

e1 Effort Remediation debt — work required to fix once spotted

Closest to 'one-line patch or single-call swap' (e1). The quick_fix explicitly states: replace 'as Type' with 'satisfies Type' for config objects. This is a single-keyword substitution at each call site — a straightforward one-line change per occurrence.

b3 Burden Structural debt — long-term weight of choosing wrong

Closest to 'localised tax' (b3). The choice applies to web and cli contexts broadly, but satisfies is a per-expression operator. Its scope is localised to the specific type annotations where it's used. It doesn't impose a cross-cutting structural burden; only the files and components using the pattern are affected.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap' (t7). The misconception field explicitly states that developers conflate satisfies with 'as' type assertion. This is a serious trap because 'as' and satisfies look syntactically similar in intent (both relate to types), but 'as' silences errors and widens types while 'satisfies' validates without widening. This directly contradicts how a developer familiar with 'as' would guess the operator behaves, and the 'obvious' migration path (using 'as' everywhere) is actually the wrong choice.

About DEBT scoring →

TL;DR

satisfies validates that a value matches a type without widening the inferred type — keeping precise literal types while checking against an interface.

Explanation

Before satisfies, you had to choose: use 'as Type' (loses inference) or rely on inference (no type safety). satisfies validates the shape without widening. Example: const palette = { red: [255,0,0], green: '#00ff00' } satisfies Record<string, string | number[]> — TypeScript knows palette.red is number[] (not string | number[]) because inference is preserved. This enables calling .toUpperCase() on palette.green without a type assertion, while still checking it conforms to the Record type. Useful for config objects, CSS-in-JS, and any case where you want validation without losing specificity.

Common Misconception

satisfies is the same as 'as' type assertion — 'as' forces a type and can hide errors. satisfies validates without widening.

Why It Matters

satisfies allows type-safe config objects and large data structures where you want both validation and precise property types — previously impossible without redundancy.

Common Mistakes

  • Using 'as Type' when satisfies is more appropriate — 'as' silences errors.
  • Using satisfies without understanding it preserves inferred types for each property.
  • Expecting satisfies to change the runtime behaviour — it's compile-time only.

Code Examples

✗ Vulnerable
// As-assertion loses specificity:
const config = {
    timeout: 5000,
    endpoint: '/api'
} as Config; // config.timeout is now Config['timeout'], not 5000
✓ Fixed
type Config = { timeout: number; endpoint: string };

const config = {
    timeout: 5000,    // TypeScript knows this is 5000, not just number
    endpoint: '/api'  // TypeScript knows this is '/api', not just string
} satisfies Config;

config.timeout; // type: 5000 (literal) — not number

Added 22 Mar 2026
Views 54
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 1 ping W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 1 ping W 1 ping T 2 pings F 0 pings S 1 ping S 0 pings M 1 ping T 2 pings W 1 ping T 1 ping F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 2 pings S 0 pings M 2 pings T 0 pings W
No pings yet today
PetalBot 2
Amazonbot 14 Scrapy 8 Google 5 Ahrefs 5 ChatGPT 3 Unknown AI 3 SEMrush 3 Meta AI 2 Perplexity 2 PetalBot 2 Claude 1
crawler 43 crawler_json 3 pre-tracking 2
DEV INTEL Tools & Severity
🔵 Info ⚙ Fix effort: Low
⚡ Quick Fix
Replace 'as Type' for config objects with 'satisfies Type' to preserve literal types while validating shape.
📦 Applies To
typescript 4.9 web cli
🔗 Prerequisites
🔍 Detection Hints
satisfies
Auto-detectable: ✗ No typescript
🤖 AI Agent
Confidence: Low False Positives: Medium ✓ Auto-fixable Fix: Low Context: Line


✓ schema.org compliant