Skip to content

--prettier-config throws misleading error if custom config isn't JSON #222

@ikornienko

Description

@ikornienko

When I used --prettier-config .prettierrc.js I've got an an error Prettier: couldn’t find '.prettierrc.js' in .... It turned out that the error is misleading, as the exception was about config not being a valid JSON.

In general, I see more and more people prefer .eslintrc.js and prettierrc.js over JSON, as JavaScript allows sharing configurations through import / export (and it's just nicer than JSON). Haven't found Prettier exposing any API for reading the config file, but it does state in the docs it uses cosmiconfig. It would be great if swagger-to-ts also used cosmiconfig to read any Prettier config file.

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