The default way of generating a parser does not seem to typecheck in v4.2.1:
const parser = peggy.generate(grammar, {
output: 'source',
format: 'commonjs',
plugins: [tspegjs],
tspegjs: {
customHeader: "// import lib\nimport { Lib } from 'mylib';"
}
}
TypeScript does not like this:
This can be fixed by removing either output: 'source' or tspegjs – having both together is not allowed.