skillfed

tree-sitter-typescript

TypeScript and TSX grammars for tree-sitter

tree-sitter-typescript v0.23.2 7.8M downloads/30d#1,692 on PyPI529
Permissive license MIT AGING released

What it is and what it does

tree-sitter-typescript is a grammar module that plugs into the tree-sitter incremental parser framework, providing language definitions for TypeScript and TSX (TypeScript with JSX). It lets you parse TypeScript and TSX source code into syntax trees that can be queried and analyzed programmatically. The package ships as precompiled binaries for major platforms, reducing setup friction.

You use this when you need to analyze, transform, or lint TypeScript code at the syntax level—building developer tools, linters, code generators, or IDE features. It's part of the tree-sitter ecosystem, which emphasizes speed and incremental updates; the grammar itself is maintained by the tree-sitter project and tracks the TypeScript language spec.

Use it for:

  • Build a TypeScript linter or code analyzer that needs to walk the syntax tree.
  • Generate code transformations or refactoring tools for TypeScript projects.
  • Implement IDE features like symbol navigation or syntax highlighting for TypeScript.
  • Parse and analyze TypeScript codebases for metrics, complexity, or dependency extraction.
  • Create a code formatter or pretty-printer for TypeScript and TSX.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides TypeScript and TSX language grammars for tree-sitter, enabling incremental parsing and syntax tree generation for TypeScript and JSX code.

Yes, if you are building tools that need to parse TypeScript or TSX and you are already using tree-sitter. The package is well-maintained within the tree-sitter ecosystem, has no known vulnerabilities, and provides prebuilt binaries for common platforms. Install friction is moderate but manageable. Not necessary if you only need basic TypeScript parsing or are using a different parsing framework.

Install

tree-sitter-typescript on PyPI

pip

pip install tree-sitter-typescript

uv

uv add tree-sitter-typescript

poetry

poetry add tree-sitter-typescript

Installing tree-sitter-typescript

Before you install

Medium install friction due to compiled binary wheels; prebuilt wheels available for common platforms (macOS x86_64/arm64, Linux x86_64/aarch64, Windows). Last release was 641 days ago; repository is active but aging.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.

Quickstart

pip install tree-sitter-typescript

from tree_sitter_typescript import get_language

lang = get_language('typescript')
# or for TSX: lang = get_language('tsx')

Requires Python >=3.9 and a tree-sitter parser instance to work with; this package provides only the grammar, not the parser itself.

Verify before relying

  • Whether tree-sitter core library is a runtime dependency (not listed in friction evidence but likely required to use the grammar).
  • Performance characteristics for large codebases or real-time parsing scenarios.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 641 days since the last release
Last repo commit
First released
Downloads 7,804,794/month — #1,692 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tree_sitter_typescript-0.23.2-cp39-abi3-macosx_10_9_x86_64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-macosx_11_0_arm64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-musllinux_1_2_x86_64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-win_amd64.whl; tree_sitter_typescript-0.23.2-cp39-abi3-win_arm64.whl

Keywords: incremental, parsing, tree-sitter, typescript, tsx

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseTopic :: Software Development :: CompilersTopic :: Text Processing :: LinguisticTyping :: Typed

Tags

typescript parser tree-sittertsx grammar parsingincremental typescript parsingtree-sitter language grammartypescript ast generationjsx syntax treetypescript code analysis
parsingtypescriptsyntax-tree

More Linguistic packages

Further reading