kuceb / eslint-plugin-json-format

Format and auto-fix your JSON using ESLint
MIT License
41 stars 3 forks source link

Format arrays with one item on a single line #43

Open martinratinaud opened 2 years ago

martinratinaud commented 2 years ago

Hi

I'm planning to use this json linter for our Open Source project https://www.opentermsarchive.org and was wondering how it could be possible to customize the display of the JSON.

For example

{
  "name": "Aigle",
  "documents": {
    "General Conditions of Sale": {
      "fetch": "https://www.aigle.com/fr/fr/terms.html",
      "select": [".terms"]
    }
  }
}

gets formatted like

{
  "name": "Aigle",
  "documents": {
    "General Conditions of Sale": {
      "fetch": "https://www.aigle.com/fr/fr/terms.html",
      "select": [
        ".terms"
      ]
    }
  }
}

(note the line break after select)

This makes the file less readable.

Can you please describe what should be done to achieve this (as I'm not really familiar with programmatic linting).

Thanks