js-formatter icon indicating copy to clipboard operation
js-formatter copied to clipboard

How to reliably read `dprint.json` from a user's project?

Open jasonkuhrt opened this issue 1 year ago • 0 comments

Hey, here's my situation:

  1. Given a tool X that applies dprint programmatically to code that it generates into a users project Y
  2. 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!

jasonkuhrt avatar Oct 25 '24 16:10 jasonkuhrt