Closed Nexucis closed 2 years ago
I believe there is currently nothing in the generated output that would require a type declaration, so you should be able to just treat it as typescript.
ah yeah it works just like that :o.
Thanks ! and sorry for the noise
Hi,
Currently
lezer-generator
is generating the files in Javascript. Would it be possible to generate in Typescript when using a new flag like--format=ts
where the default value would bejs
.Why I would like that ?
I'm currently maintaining two repositories lezer-promql and codemirror-promql and I would like to move
lezer-promql
incodemirror-promql
.Since I wrote
codemirror-promql
in typescript, if thelezer-generator
was able to generate the files in typescript, I could directly use the generated file in my code and then simply rely ontsc
to generate theesm
andcjs
file.It could even be interested when we still want to keep the lezer grammar in a separated npm package, because we could again simply use
tsc
to generate the CommonJS module and the ESM module instead of using rollup. It would also generated automatically the filed.ts
.Would it be something acceptable for you ? I could make the PR if you are interested.