Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

XO + Prettier + JSON / YAML #776

Open
sekhavati opened this issue Jan 24, 2025 · 0 comments
Open

XO + Prettier + JSON / YAML #776

sekhavati opened this issue Jan 24, 2025 · 0 comments

Comments

@sekhavati
Copy link

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.

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

No branches or pull requests

1 participant