我'm using Prettier 1.14.0 with Prettier Formatter for Visual Studio Code. I' ve遇到了函数参数格式不稳定的问题 . 例如,要求我保持字符串 compose(field('tags'), orEmpty, commaList, usertag())()(user), 内联,而第二个强制它像这样

compose(
          field('tags'),
          orEmpty,
          commaList,
          usertag(),
        )()(user),

我希望两者都像第二种情况 . 它看起来像 parser 不适用于package.json ...这里有一些配置:

package.json

"prettier": {
    "parser": "flow",
    "printWidth": 80
  },
"eslintConfig": {
    "parser": "babel-eslint",
    "extends": [
      "standard",
      "prettier",
      "plugin:import/recommended"
    ],
    "plugins": [
      "prettier",
      "simple-complexity",
      "import",
      "import-order-autofix",
      "filenames"
    ],
    "settings": {
      "import/resolver": "webpack",
      "import/ignore": [
        "node_modules"
      ]
    },
    "rules": {
      "filenames/match-exported": [
        "error"
      ],
      "import-order-autofix/order": [
        "error",
        {
          "newlines-between": "always"
        }
      ],
      "prettier/prettier": [
        "error",
        {
          "parser": "flow",
          "printWidth": 80,
          "singleQuote": true,
          "trailingComma": "all",
          "bracketSpacing": false,
          "semi": false,
          "requirePragma": true,
          "insertPragma": true
        }
      ],
      "comma-dangle": [
        "error",
        {
          "arrays": "always-multiline",
          "objects": "always-multiline",
          "imports": "always-multiline",
          "exports": "always-multiline",
          "functions": "always-multiline"
        }
      ],
      "complexity": [
        "error",
        {
          "max": 15
        }
      ],
      "max-nested-callbacks": [
        "error",
        {
          "max": 3
        }
      ],
      "max-statements": [
        "error",
        {
          "max": 10
        }
      ],
      "max-params": [
        "error",
        {
          "max": 4
        }
      ],
      "max-lines": [
        "error",
        {
          "max": 350,
          "skipBlankLines": true,
          "skipComments": true
        }
      ],
      "max-depth": [
        "error",
        {
          "max": 3
        }
      ],
      "simple-complexity/max-indent": [
        "error",
        {
          "max": 20
        }
      ]
    }
  },

.eslintrc

{
  "extends": "react-app",
  "plugins": [
    "prettier",
    "simple-complexity",
    "import",
    "import-order-autofix",
    "filenames"
  ],
  "rules": {
    "filenames/match-exported": ["error"],
    "import-order-autofix/order": [
      "error",
      {
        "newlines-between": "always"
      }
    ],
    "prettier/prettier": [
      "error",
      {
        "singleQuote": true,
        "trailingComma": "all",
        "bracketSpacing": false,
        "semi": false,
        "requirePragma": true,
        "insertPragma": true
      }
    ],
    "comma-dangle": [
      "error",
      {
        "arrays": "always-multiline",
        "objects": "always-multiline",
        "imports": "always-multiline",
        "exports": "always-multiline",
        "functions": "always-multiline"
      }
    ],
    "complexity": [
      "error",
      {
        "max": 15
      }
    ],
    "max-nested-callbacks": [
      "error",
      {
        "max": 3
      }
    ],
    "max-statements": [
      "error",
      {
        "max": 10
      }
    ],
    "max-params": [
      "error",
      {
        "max": 4
      }
    ],
    "max-lines": [
      "error",
      {
        "max": 350,
        "skipBlankLines": true,
        "skipComments": true
      }
    ],
    "max-depth": [
      "error",
      {
        "max": 3
      }
    ],
    "simple-complexity/max-indent": [
      "error",
      {
        "max": 20
      }
    ]
  }
}

.vscode/settings

{
    "[javascript]": {
        "editor.formatOnSave": true,
    },
    "prettier.eslintIntegration": true,
    "editor.tabSize": 2,
    "files.watcherExclude": {
        "**/.git/objects/**": true,
        "**/.git/subtree-cache/**": true,
        "**/node_modules/*/**": true
    },
}

My plugins