Typed service path inventory
This page inventories typed callpaths that can reach parser services or the TypeScript checker.
Source document:
docs/internal/typed-paths.md
Guard modelβ
The plugin follows a syntax-first design.
- Shared typed access flows through
getTypeOfNode(node, context)insrc/util/rule.ts. - That helper calls
ESLintUtils.getParserServices(context, true)and returnsnullwhen parser services or aprogramare unavailable. - Rules consuming the helper treat
nullas a normal fallback path rather than crashing.
Core typed helperβ
| Path | Typed dependency | Current callers | Fallback behavior | Max expected expensive calls/file |
|---|---|---|---|---|
src/util/rule.ts#getTypeOfNode | parserServices.program, checker, ESTreeβTS node map | immutable-data, readonly-array | Catches parser-service failures and returns null | Up to 4 lookups in one immutable-data mutator path; per implicit candidate in readonly-array |
Rule callpath inventoryβ
immutable-dataβ
- Uses type lookups to distinguish mutating array/object operations from freshly-created values.
- Consults checker-backed type information for chained array constructors and
Object.assign(...)targets. - Falls back to its conservative
assumeTypesbehavior when type services are unavailable.
readonly-arrayβ
- Uses type lookups only for implicit mutable-array inference when a declaration or parameter lacks an explicit annotation.
- Still reports explicit
T[],Array<T>, and tuple syntax without any parser services. - Skips the implicit inference branch when
getTypeOfNode(...)returnsnull.
Operational guidanceβ
- Enable
projectService: truewhen you want the highest semantic precision. - Treat
nullfromgetTypeOfNode(...)as an expected soft-failure path. - Keep typed lookups narrow and local to already-filtered AST nodes.