dprint / dprint

Pluggable and configurable code formatting platform written in Rust.

Home Page:https://dprint.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Config - Ability to include subset of another arbitrary JSON file

dsherret opened this issue · comments

For example:

// biome.json
{
  "formatter": {
    "enabled": true,
    "indentStyle": "tab",
    "indentWidth": 2,
    "lineWidth": 80,
    "lineEnding": "lf",
    "ignore": []
  }
}

Then something like (not sure about how this should be):

// dprint.json
{
  "biome": {
    // includes the properties in the "formatter" object in biome.js which
    // get flattened into this object
    "$include:biome.json#formatter": {
      "exclude": ["enabled", "ignore"] // excludes these properties
    },
    // anything below overrides what's in the config (while anything above gets overridden)
    "indentStyle": "space"
  }
  // etc...
}

Not sure about the exact syntax or if there's precedence in some other software for how this can be done.