MaibornWolff / metric-gardener

BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Add type for Tree sitter grammar #333

Closed mylinhdao closed 2 months ago

mylinhdao commented 2 months ago

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.