tree-sitter-typescript

Typescript grammar for tree-sitter


Keywords
parsing, incremental, tsx, typescript, parser, tree-sitter
License
MIT

Documentation

tree-sitter-typescript

CI Discord Rust Crate Node Package

TypeScript and TSX grammars for tree-sitter.

Because TSX and TypeScript are actually two different dialects, this module defines two grammars. Require them as follows:

require("tree-sitter-typescript").typescript; // TypeScript grammar
require("tree-sitter-typescript").tsx; // TSX grammar

For Javascript files with flow type annotations you can use the the tsx parser.

References