Skip to content

custom parsers are ignored by option normalisation #50

@43081j

Description

@43081j

prettier-cli/src/utils.ts

Lines 495 to 501 in ad666d6

if ("parser" in options) {
const value = options.parser;
// prettier-ignore
if (value === "flow" || value === "babel" || value === "babel-flow" || value === "babel-ts" || value === "typescript" || value === "acorn" || value === "espree" || value === "meriyah" || value === "css" || value === "less" || value === "scss" || value === "json" || value === "json5" || value === "json-stringify" || value === "graphql" || value === "markdown" || value === "mdx" || value === "vue" || value === "yaml" || value === "glimmer" || value === "html" || value === "angular" || value === "lwc") {
formatOptions.parser = value;
}
}

we have a hard-coded list of allowed parsers. this means custom parsers are lost at this point

somehow we should merge custom parsers into this list

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