tree-sitter-typescript

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

Library
Cargo
v0.23.2
532 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
56 /100 Fair
Development Activity 44
Maintenance 20
Community 80
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
74 /100 Good
Architecture 78
Code Quality 74
Innovation 72
Learning Curve 70

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 12 apps in this directory

TypeScript
72%
MIT

Claude Context

AI Code Assistants · Mcp

12,573

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
46
Repo Health
71
Technical
71
Dependency
Built with
TypeScript 72%
Python 13%
JavaScript 11%
Updated 2 months ago
TypeScript
46%
Apache 2.0

claude-mem

AI Agents · AI Development · AI Memory

94,808

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
TypeScript 46%
JavaScript 40%
Python 12%
Updated 5 days ago
Rust
52%
Apache 2.0

cocoindex

AI Development · Data Engineering

11,607

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

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 52%
Python 48%
Updated 4 days ago
C
83%
MIT

codegraph

AI Code Assistants · Developer Tools

72,201

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
84
Repo Health
85
Technical
70
Dependency
Built with
C 83%
TypeScript 14%
Updated 5 days ago
Rust
88%
GPL 2.0

Fresh

Code Editors · Developer Tools

9,052

A zero-configuration terminal text editor with familiar keybindings, full mouse support, LSP-powered IDE features, and a built-in orchestrator for running multiple coding agents in parallel worktrees.

View details
86
Repo Health
88
Technical
71
Dependency
Built with
Rust 88%
Updated 5 days ago
TypeScript
91%
Other

GitNexus

AI Code Assistants · Developer Tools · Mcp

47,620

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
TypeScript 91%
Updated 4 days ago
Python
100%
MIT

Graphify

AI Agents

121,917

A YC-backed, open-source knowledge graph skill for AI coding assistants — type /graphify and it maps your entire project (code, docs, PDFs, images, videos) into a queryable graph instead of grepping through files.

View details
83
Repo Health
73
Technical
72
Dependency
Built with
Python 100%
Updated 5 days ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 4 days ago
Rust
93%
Other

Tabby

AI Code Assistants

33,892

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

View details
58
Repo Health
78
Technical
61
Dependency
Built with
Rust 93%
Updated 3 months ago

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