Skip to content

Types prevent output: source and giving tspegjs options #118

@fefrei

Description

@fefrei

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions