Skip to content

XO + Prettier + JSON / YAML #776

Open
@sekhavati

Description

Is there a way to configure XO so that it also passes file types like JSON and YAML through Prettier when its formatting files?

In my setup which has prettier: true it seems to only format TS/JS files, which is half expected I guess given its a ESLint wrapper.

I've tried adding extensions: ["json"] but then other linter errors pop up, presumable because JSON is then being fed into eslint plugins that were expecting JS/TS.

To clarify, I only want to format these file types with Prettier, I don't need to lint them.

I have read through the issue below and noted its similarity but the answers seem to focus on linting (not formatting). Maybe I've missed the point?

#676

I guess I could dip into ./node_modules/xo/node_modules/prettier and execute what I need, but I'm hoping there's a better way I've missed. Also adding Prettier explicitly would then need a bit of thought to ensure the version in the project stayed in sync with XO's.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions