Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Types prevent output: source and giving tspegjs options #118

Open
fefrei opened this issue Oct 12, 2023 · 0 comments
Open

Types prevent output: source and giving tspegjs options #118

fefrei opened this issue Oct 12, 2023 · 0 comments

Comments

@fefrei
Copy link

fefrei commented Oct 12, 2023

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:

image

This can be fixed by removing either output: 'source' or tspegjs – having both together is not allowed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant