避免在createElement语法中使用换行符

时间:2018-06-13 14:25:47

标签: visual-studio-code

以下是示例代码:     Sample code

由于某些原因,Visual Studio代码不断为React Components添加不必要的换行符。

什么时候看起来像这样:

Proper style

以下是我对VSC的设置:

{
  "editor.formatOnSave": false,
  "editor.fontSize": 18,
  "editor.tabSize": 2,
  "editor.insertSpaces": true,
  "editor.detectIndentation": false,
  "editor.wordWrap": "on",
  "workbench.colorTheme": "Monokai Dimmed",
  "prettier.printWidth": 80,
  "prettier.tabWidth": 2,
  "prettier.useTabs": false,
  "prettier.bracesSpacing": true,
  "prettier.trailingComma": "all",
  "prettier.bracketSpacing": false,
  "prettier.arrowParens": true,
  "eslint.autoFixOnSave": true,
  "files.associations": {
      "*.js": "javascriptreact"
  },
  "liveServer.settings.donotVerifyTags": true,
  "liveServer.settings.donotShowInfoMsg": true,
  "workbench.iconTheme": "vscode-icons",
  "gitlens.advanced.messages": {
    "suppressShowKeyBindingsNotice": true
  },
  "eslint.options": {
    "rules": {
      "no-debugger": "off",
    }
  },
  "gitlens.historyExplorer.enabled": true,
}

prettier具有项目特定的样式设置,eslinteditor是我自己的首选项。

0 个答案:

没有答案