TypeScript 5.9
Last reviewed Oct 11, 2026
Prompt Details
Prompt Composition
2prompts
- JavaScript ES2026102 lines · 3.1K tokens
- TypeScript 5.940 lines · 1.2K tokens
Total142 lines · 4.3K tokens
CWE Coverage
- 20
- 73
- 79
- 89
- 95
- 117
- 200
- 208
- 209
- 323
- 338
- 346
- 347
- 352
- 362
- 459
- 471
- 494
- 502
- 602
- 770
- 807
- 829
- 838
- 862
- 915
- 916
- 918
- 922
- 943
- 1004
- 1321
- 1333
Prompt Preview
Apply the JavaScript ES2026 baseline first. These rules cover TypeScript 5.9.
Compiler checks
- Enable
strictwith every strict-family check in production; fail CI ifnoCheckor--noCheckis set, since it reports only critical parse and emit errors. - Gate deployment on a successful type check of all production sources, with
noEmitOnError(defaultfalse) whentscemits release files andcheckJsfor included JavaScript. - Enable
noUncheckedIndexedAccess,exactOptionalPropertyTypes,useUnknownInCatchVariables(narrow caught values before reading properties or exposing details),noImplicitOverride,noFallthroughCasesInSwitch, andnoImplicitReturns.
Trust boundaries
- Type parsed JSON, request bodies, environment variables, storage values, and SDK responses as
unknownat entry points; narrow them with runtime schemas or type guards checking every security-relevant property and rejecting unknown keys that could enable mass assignment, policy bypass, or version confusion. - Never use type assertions, including doubles like
value as unknown as TrustedType, to make untrusted data an authenticated identity, authorization decision, validated command, or other incompatible security type; keep validated branded types distinct from raw strings for identifiers, URLs, paths, secrets, and tenant-scoped keys. - Prohibit
anyat trust boundaries, containing unavoidableanyin a small reviewed adapter; avoid non-null assertions on request, configuration, lookup, or async values. - Never suppress errors with
@ts-ignoreor file-level@ts-nocheck;