由于某些原因,Visual Studio代码不断为React Components添加不必要的换行符。
什么时候看起来像这样:
以下是我对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
具有项目特定的样式设置,eslint
和editor
是我自己的首选项。