【发布时间】:2023-01-09 01:26:11
【问题描述】:
我在 VS 代码中安装了“更漂亮”的扩展。
缩进设置为 2 个空格。
"prettier.tabWidth": 2,
现在 VS 代码以红色突出显示缩进字段。
VS 代码希望有 4 个空格。
如何在 VS 代码中设置 2 个空格?
或者我怎样才能在 VS 代码中删除这个红色突出显示?
【问题讨论】:
标签: visual-studio-code prettier
我在 VS 代码中安装了“更漂亮”的扩展。
缩进设置为 2 个空格。
"prettier.tabWidth": 2,
现在 VS 代码以红色突出显示缩进字段。
VS 代码希望有 4 个空格。
如何在 VS 代码中设置 2 个空格?
或者我怎样才能在 VS 代码中删除这个红色突出显示?
【问题讨论】:
标签: visual-studio-code prettier
我找到了解决问题的方法!
这是我的设置.json
// Distance of padding.
"prettier.tabWidth": 2,
// The number of spaces corresponding to a tab.
"editor.tabSize": 2,
// Insert spaces when pressing the TAB key. This setting is overridden based on the content of the file if the "editor.detectIndentation" setting is enabled.
"editor.insertSpaces": true,
// Based on the contents of the file, determines whether "editor.tabSize" and "editor.insertSpaces" are automatically detected when the file is opened.
"editor.detectIndentation": false,
【讨论】: