Typed service path inventory
This page inventories the current typed callpaths that can reach parser services or the TypeScript checker.
Source document:
docs/internal/typed-paths.md
Guard modelβ
All current typed access is opportunistic, not mandatory:
getFullTypeChecker(context)returns ats.TypeCheckeronly when ESLint parser services expose a fullprogram.hasFullTypeInformation(context)reports whether that richer TypeScript surface is available.- Helper functions fall back to conservative syntax-only behavior when the checker or ESTreeβTypeScript node maps are unavailable.
Core typed helpersβ
| Path | Typed dependency | Guard entry | Fallback behavior |
|---|---|---|---|
src/_internal/ast-utils.ts#hasFullTypeInformation | parserServices.program | Called directly by rules/helpers that want to know whether full TS services exist | Returns false when no full parser services are available |
src/_internal/ast-utils.ts#getFullTypeChecker | parserServices.program.getTypeChecker() | Called directly from rules before optional typed checks | Returns undefined |
src/_internal/ast-utils.ts#getNodeTypeAsString | checker + ESTree/TS node maps | Caller passes the optional checker returned by getFullTypeChecker | Returns "any" when the checker or maps are unavailable |
src/_internal/ast-utils.ts#isDocumentObject | optional checker | Caller passes the optional checker returned by getFullTypeChecker | Uses syntax-only checks for document, window.document, or globalThis.window.document |
Current rule callpath inventoryβ
No current SDL rule sets meta.docs.requiresTypeChecking. Instead, the following rules optionally use type information when it exists and degrade gracefully when it does not.
Rules with optional typed refinementβ
src/rules/no-cookies.tssrc/rules/no-document-domain.tssrc/rules/no-document-write.tssrc/rules/no-inner-html.tssrc/rules/no-insecure-random.tssrc/rules/no-postmessage-star-origin.ts
What the typed paths do todayβ
- Document-object refinement helps distinguish the browser
Documentobject from unrelated identifiers. - Type-name checks help confirm risky APIs such as
Window,Document,Math, orCryptobefore a report is emitted. - Syntax fallback keeps the rules useful in non-type-aware lint runs, especially for obvious
document,window.document,Math.random, orpostMessage("*")patterns.
Inventory noteβ
This inventory intentionally reflects the current SDL plugin architecture rather than the older fork-era typed-rule framework.