tree-sitter-typescript

TypeScript and TSX grammars for the tree-sitter incremental parsing framework.

Library
Cargo
v0.23.2
532stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
45/100Fair
Development Activity0
Maintenance20
Community80
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture78
Code Quality74
Innovation72
Learning Curve70

tree-sitter-typescript provides two tree-sitter grammars — one for TypeScript and one for TSX — that let editors, linters, and static-analysis tools build and incrementally update a concrete syntax tree for TypeScript source files. Because TSX is a genuinely distinct dialect (JSX syntax mixed with TypeScript types), the package ships it as a separate grammar rather than trying to overload a single parser for both.

The grammar is distributed as native bindings for Rust, Node.js, Python, Go, Swift, and C/CMake consumers, so the same underlying parser (generated from grammar.js and compiled C parser tables) can be embedded in editors like Neovim and Helix, in language-server tooling, or in any application that needs a fast, error-tolerant TypeScript parse tree rather than a full type-checking compiler.

What You Get

  • Two separate grammars — typescript and tsx — reflecting that TSX is a distinct dialect from plain TypeScript
  • Native bindings for Rust, Node.js, Python, Go, Swift, and C/CMake so the parser can be embedded in editors and tooling written in any of those languages
  • Query files under queries/ for syntax highlighting and other tree-sitter-consuming features
  • Incremental, error-tolerant parsing suitable for live-editing scenarios rather than a batch compiler pass
  • A CI-tested grammar kept in sync with the upstream tree-sitter grammar DSL and parser generator

Common Use Cases

  • Powering TypeScript/TSX syntax highlighting in editors such as Neovim, Helix, and other tree-sitter-based editors
  • Building structural code search, refactoring tools, or linters that need a real syntax tree rather than regex-based matching
  • Embedding a TypeScript parser in a Rust, Python, or Node.js application via the language-specific bindings
  • Implementing custom static-analysis or code-intelligence tooling that needs incremental re-parsing as a file is edited

Under The Hood

Architecture - The grammars are defined in typescript/grammar.js and tsx/grammar.js using tree-sitter’s grammar DSL, then compiled by the tree-sitter CLI into C parser tables checked into typescript/src and tsx/src. Per-language bindings live under bindings/ (c, rust, node, python, go, swift), each a thin wrapper that loads the compiled parser and exposes it through that language’s native API; queries/ holds tree-sitter query files consumed by editors for highlighting and other features.

Tech Stack - The grammar definitions are JavaScript, but the generated parsers are C (22.7% of the repo), with Rust bindings built via a build.rs script declared in Cargo.toml, Node bindings via binding.gyp, and equivalent packaging for Python (setup.py/pyproject.toml), Go (go.mod), and Swift (Package.swift) — a genuinely polyglot distribution model built around one shared C parser core.

Code Quality - CI (GitHub Actions) runs the grammar’s test corpus on every change; the project has a low but steady maintenance cadence (739 total commits since 2017, most recent release in November 2024) reflecting that TypeScript/TSX grammar changes are infrequent once a language’s syntax stabilizes, though this also means newer TypeScript syntax may lag behind the latest release.

API Design - Consumers require two distinct exports — require('tree-sitter-typescript').typescript and .tsx — which is a deliberate, low-boilerplate way of surfacing that TSX is not simply ‘TypeScript inside a JSX file.’ Each language binding follows that host language’s idiomatic parser API (e.g. tree_sitter::Language in Rust), so developers already familiar with tree-sitter in one language transfer that knowledge easily to another.

Used by 7 apps in this directory

TypeScript
72%
MIT

Claude Context

AI Code Assistants

12,498

An MCP server and VS Code extension by Zilliz that turns your entire codebase into semantically searchable context for Claude Code, Cursor, and Gemini CLI, using vector embeddings and Merkle-tree change detection.

View details
49
Repo Health
71
Technical
71
Dependency
Built with
TypeScript72%
Python13%
JavaScript11%
Updated 1 months ago
JavaScript
51%
Apache 2.0

claude-mem

AI Agents · AI Development

93,347

Give your AI coding agents persistent memory — claude-mem captures everything that happens during sessions, compresses it with AI, and surfaces the right context in every future session automatically.

View details
86
Repo Health
82
Technical
77
Dependency
Built with
JavaScript51%
TypeScript47%
Updated yesterday
Rust
52%
Apache 2.0

cocoindex

Data Engineering · AI Development

11,496

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
86
Repo Health
85
Technical
64
Dependency
Built with
Rust52%
Python48%
Updated 2 days ago
C
86%
MIT

codegraph

Developer Tools · AI Code Assistants

69,843

A pre-indexed code knowledge graph that cuts AI tool calls by 58% and token costs by 16% — auto-syncing, 100% local, works with Claude Code, Cursor, Codex, and more.

View details
82
Repo Health
85
Technical
72
Dependency
Built with
C86%
TypeScript11%
Updated 1 weeks ago
TypeScript
92%
Other

GitNexus

Developer Tools · AI Code Assistants

47,086

Index any codebase into an interactive knowledge graph and give your AI agents deep architectural context via MCP — with zero servers required.

View details
88
Repo Health
86
Technical
73
Dependency
Built with
TypeScript92%
Updated yesterday
Rust
93%
Other

Tabby

AI Code Assistants

33,868

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
60
Repo Health
78
Technical
61
Dependency
Built with
Rust93%
Updated 2 months ago
Rust
31%
Other

Windmill

Automation · Developer Tools

17,793

Turn scripts into webhooks, workflows, and auto-generated UIs — the fastest self-hostable workflow engine, 13x faster than Airflow.

View details
91
Repo Health
82
Technical
65
Dependency
Built with
Rust31%
TypeScript23%
Svelte23%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search