Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我按Shift++让 VS Code 格式化我的 JS 源代码,它会Alt转换F
for(var key in indexObj)
至
for (var key in indexObj)
如何防止 VS Code 这样做?
.jsbeautifyrc
space_before_conditional
false
.js
要在没有插件的情况下解决此问题,您可以在 vscode settings.json上设置配置:
{ "editor.formatOnSave": false, "editor.formatOnType": false }
或转到File - Preferences - Settings,寻找Format On Save并取消选中它。