millermedeiros / esformatter

ECMAScript code beautifier/formatter
MIT License
970 stars 91 forks source link

Non flattened imports #493

Open maikelmclauflin opened 6 years ago

maikelmclauflin commented 6 years ago

I'm probably just doing it wrong but I do not seem to be able to get my imports to stay stacked on top of one another

import {
    connect
} from 'react-redux'

always turns into

import { connect } from 'react-redux'

I'm pretty sure i have the right options in there.

{

  "esformatter": {
    "allowShebang": true
  },

  "indent": {
    "value": "    ",
    "alignComments": true
  },

  "lineBreak": {
    "value": "\n",
    "before": {
      "VariableDeclaration": 1,
      "FunctionDeclaration": ">=2",
      "FunctionDeclarationClosingBrace": "<=1",
      "FunctionExpressionClosingBrace": "<=1",
      "ObjectPatternClosingBrace": 1
    },
    "after": {
      "ObjectPatternComma": 1,
      "ObjectPatternOpeningBrace": 1,
      "FunctionDeclarationOpeningBrace": ">=0",
      "FunctionExpressionOpeningBrace": ">=0",
      "FunctionDeclarationClosingBrace": "<=1",
      "FunctionExpressionClosingBrace": "<=1"
    }
  },

  "whiteSpace": {
    "value": " ",
    "removeTrailing": 1,
    "after": {
      "ParameterComma": 1,
      "Property": 1,
      "FunctionReservedWord": 1,
      "FunctionDeclarationOpeningBrace": 0
    },
    "before": {
      "VariableValue": 1,
      "Property": 1,
      "PropertyValue": 1,
      "FunctionDeclarationClosingBrace": ">=0"
    }
  }
}