![](/img/trans.png)
[英]Does vscode support removing spaces after opening and before closing curly braces now?
[英]How to tell auto-format in VS Code not to insert spaces after opening and before closing curly braces?
每當我在包含這段代碼的文件中使用Visual Studio Code中的自動格式快捷鍵( Shift + Alt + k )時 -
var keyframes = [
{opacity: 0, transform: 'translate(0, 4em)'},
{opacity: 1, transform: 'translate(0)'}
];
我明白了 -
var keyframes = [
{ opacity: 0, transform: 'translate(0, 4em)' },
{ opacity: 1, transform: 'translate(0)' }
];
我想知道是否有任何方法可以告訴自動格式不插入所有空格?
抱歉,格式化選項當前未向用戶公開。 我們的積壓很高。
如果有人在反應中尋找那個選項,那就是:
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": true
然后它將格式化
<option key={org.id} value={org.id}>{org.displayName}</option>
像這樣:
<option key={ org.id } value={ org.id }>{ org.displayName }</option>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.