A.k.a. nested config, for LSP.
I plan to add CLI support later, LSP support for start.
(So, please do not merge for a while. 🙏🏻)
- Before: At startup, it finds-up for config file starting from the workspace root
- It followed the same behavior as the CLI
- After: When a formatting request is made, it finds-up for a config file starting from the target file and then caches
- Unlike Oxlint, Oxfmt does not have the concept of a root config, so this approach is sufficient
- In the first place, I don't see any reason to parse a config file when you don't even know if it's going to be used
- Unchanged:
- It still resolves a single `.prettierignore` and `.editorconfig` as before
- When `configPath` is specified, it uses only that config file
- For in-memory file, it is resolved by workspace root