I think a single oxfmt run in the root of a monorepo should be enough to correctly and consistently format every file using its nearest config file.
If there's a discussion about nested configs and only nested configs, I'm sorry but I couldn't find it!
With this directory structure:
├── package-1/
│ ├── lib/
│ │ └── file-1.tsx
│ ├── package.json
├── package-2/
│ ├── lib/
│ │ └── file-2.tsx
│ ├── .oxfmtrc.json
│ ├── .prettierrc.json
│ ├── package.json
│ └── tailwind.css
├── .oxfmtrc.json
├── .prettierrc.json
└── package.json
Unfortunately Oxfmt is broken compared to Prettier:
- ✅
prettier walks from each source file to its nearest config file
- ⚠️
oxfmt uses the config file in the current working directory only
This makes it very hard to migrate to Oxfmt if you're using multiple Prettier configs and/or prettier-plugin-tailwindcss, because now you need to orchestrate per-package oxfmt runs, avoid their results colliding, do very weird things to configure the IDE, etc. etc.
I think a single
oxfmtrun in the root of a monorepo should be enough to correctly and consistently format every file using its nearest config file.If there's a discussion about nested configs and only nested configs, I'm sorry but I couldn't find it!
With this directory structure:
Unfortunately Oxfmt is broken compared to Prettier:
prettierwalks from each source file to its nearest config fileoxfmtuses the config file in the current working directory onlyThis makes it very hard to migrate to Oxfmt if you're using multiple Prettier configs and/or
prettier-plugin-tailwindcss, because now you need to orchestrate per-packageoxfmtruns, avoid their results colliding, do very weird things to configure the IDE, etc. etc.