将“更漂亮的其他”集成到.prettierrc

时间:2018-07-31 09:07:49

标签: eslint prettier

早上好, 我很难弄清楚如何使用此更漂亮的杂项。 (请参阅:https://github.com/arijs/prettier-miscellaneous

我要做的就是将一个选项(space-before-function-parenthesis)集成到当前的.prettierrc配置中,而该配置未包含在官方的漂亮扩展中。

这是我当前的package.json

"dependencies": {
"async": "^1.5.0",
"body-parser": "^1.15.0",
"bunyan": "^1.8.1",
"busboy": "^0.2.14",
"clarg": "0.0.3",
"compression": "^1.7.3",
"connect-flash": "^0.1.1",
"connect-redis": "^3.1.0",
"express": "^4.13.4",
"express-handlebars": "^3.0.0",
"express-session": "^1.13.0",
"lodash": "^4.11.2",
"moment": "^2.22.1",
"npm": "^5.7.1",
"redis": "^2.6.2",
"request": "^2.81.0",
"request-promise": "^2.0.1",
"sanitize-html": "^1.14.1",
"socket.io": "^2.1.0",
"sync-request": "^3.0.1"


},
  "devDependencies": {
    "chai": "^4.0.2",
    "chai-jq": "0.0.9",
    "eslint": "^3.7.1",
    "eslint-config-airbnb": "6.1.0",
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-prettier": "^2.6.2",
    "eslint-plugin-react": "4.2.3",
    "istanbul": "^0.4.5",
    "jquery": "^3.2.1",
    "jsdom": "^11.12.0",
    "mocha": "^3.4.2",
    "mocha-lcov-reporter": "^1.3.0",
    "nock": "^9.4.3",
    "prettier": "^1.14.0",
    "prettier-miscellaneous": "^1.5.3",
    "proxyquire": "^1.8.0",
    "sinon": "^5.0.7",
    "supertest": "^3.0.0"
  }

这是我当前的.prettierrc配置文件

{
"printWidth": 100,
  "tabWidth": 2,
  "useTabs": false,
  "semi": true,
  "singleQuote": true,
  "trailingComma": "none",
  "bracketSpacing": false,
  "jsxBracketSameLine": false,
  "arrowParens": "always",
  "filepath": "none",
  "requirePragma": false,
  "insertPragma": false,
  "proseWrap": "preserve"
}

我当前的全局npm软件包(如果需要)

+-- eslint-cli@1.1.1
+-- eslint-config-airbnb@16.1.0
+-- eslint-plugin-import@2.13.0
+-- eslint-plugin-jsx-a11y@6.1.1
+-- eslint-plugin-react@7.10.0
+-- handlebars@4.0.11
+-- mocha@5.2.0
+-- nodemon@1.18.3
+-- prettier@1.14.0
`-- prettier-miscellaneous@1.5.3

我试图将更漂亮/其他' space-before-function-括号包含到我的.prettierrc配置文件中(例如“ spaceBeforeFunctionParen”:true)并运行它在终端上。

例如

eslint --quiet --fix .

注意:我还将eslint用于代码质量规则,更漂亮是用于格式化。

我希望它们全部都在括号前有空格并减少错误消息。

但实际上:

Ignored unknown option `{ "spaceBeforeFunctionParen": true }`.
Ignored unknown option `{ "spaceBeforeFunctionParen": true }`.
Ignored unknown option `{ "spaceBeforeFunctionParen": true }`.

现在,我已经阅读了github和tbh中的所有线程问题30-其中40%的注释令人困惑(或者我只是菜鸟)。请说明出什么问题或不包括什么,或者我错过了什么?

0 个答案:

没有答案