eslint-plugin-json-format icon indicating copy to clipboard operation
eslint-plugin-json-format copied to clipboard

Format arrays with one item on a single line

Open martinratinaud opened this issue 2 years ago • 0 comments

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

martinratinaud avatar May 12 '22 08:05 martinratinaud