MaibornWolff / metric-gardener

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add type for Tree sitter grammar

mylinhdao opened this issue · comments

Currently, we import the tree-sitter grammars as type any or unknown in parser/helper/language.ts

// @ts-expect-error module doesn't have types
import phpTreesitterConfig from "tree-sitter-php";

const { php } = phpTreesitterConfig as { php: unknown };

So we need to add // @ts-expect-error module doesn't have types above every import line to appease the TS type strict config. We should try to find out what type the tree-sitter grammars have.