js-formatter
js-formatter copied to clipboard
How to reliably read `dprint.json` from a user's project?
Hey, here's my situation:
- Given a tool X that applies
dprintprogrammatically to code that it generates into a users project Y - Given that X wants to allow Y to control formatting options
How does X read the optional dprint configuration file in Y reliably? I could just look for a dprint.json in CWD etc. but I don't want corner cases to hit the user. E.g. the same resolution algorithm that the user's IDE uses I want my tool to use.
Is there any APIs to support this? Thanks!