Documentation
¶
Overview ¶
Package typescript is the TypeScript/TSX LanguageProvider. It parses with gotreesitter (pure Go, no CGO — see ADR 0002) and adapts its AST to the core's parser-agnostic syntax.Node (ADR 0003).
This phase (Prompt 1.1) implements identity + parsing only. The deterministic rules and surface mapping (AnalyzeSecurity/Practices/Surface) are stubs here; they arrive in Prompts 1.2/1.3.
Index ¶
- type Provider
- func (*Provider) AnalyzePractices(providers.SourceFile) ([]findings.Finding, error)
- func (p *Provider) AnalyzeSecurity(src providers.SourceFile) ([]findings.Finding, error)
- func (p *Provider) AnalyzeSurface(src providers.SourceFile) ([]findings.SurfaceItem, error)
- func (*Provider) CoverageManifest() coverage.Manifest
- func (*Provider) DefaultPathCriticality() config.PathCriticality
- func (*Provider) FileExtensions() []string
- func (*Provider) Frameworks() []string
- func (*Provider) Language() string
- func (*Provider) Parse(src providers.SourceFile) (syntax.Node, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct{}
Provider implements providers.LanguageProvider for TypeScript and TSX.
func (*Provider) AnalyzePractices ¶
AnalyzePractices is a stub; the best-practice rules arrive in Prompt 1.2.
func (*Provider) AnalyzeSecurity ¶
AnalyzeSecurity runs the embedded deterministic security rules over src and returns the findings. The provider is a thin adapter: it loads/compiles the rules (once), parses the file, and hands both to the language-agnostic ruleengine — no detection logic lives here.
func (*Provider) AnalyzeSurface ¶
func (p *Provider) AnalyzeSurface(src providers.SourceFile) ([]findings.SurfaceItem, error)
AnalyzeSurface maps the auditable structural surface of a TypeScript file by running the provider's surface queries through the agnostic framework, which stamps the stable ids. Today only IDOR (Next App Router) is wired; authz and over-fetching are added as their queries land.
func (*Provider) CoverageManifest ¶
CoverageManifest declares, in plain prose, what codefit audits for TypeScript and how — the single source for the human-facing COVERAGE.md and the codefit-coverage tool (PRD §10, RF-07). The two categories that split between a deterministic rule and mapped surface (ADR 0004) appear in BOTH lists, each side describing exactly what it covers, so an evaluator reads a division of labor, not a gap.
CoverageManifest is a provider method (not yet on the shared LanguageProvider interface) — the interface convergence is deferred until the Go provider also emits this (ADR 0003).
func (*Provider) DefaultPathCriticality ¶
func (*Provider) DefaultPathCriticality() config.PathCriticality