Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tree-sitter-typescript

tree-sitter297.8kMIT0.23.2TypeScript support: included

TypeScript and TSX grammars for tree-sitter

incremental, parsing, tree-sitter, typescript, tsx

readme

tree-sitter-typescript

CI discord matrix crates npm pypi

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 tsx parser.

References