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?
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.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too