【问题标题】:How to remove red margins in VS code?如何删除 VS 代码中的红色边距?
【发布时间】:2023-01-09 01:26:11
【问题描述】:

我在 VS 代码中安装了“更漂亮”的扩展。
缩进设置为 2 个空格。

  "prettier.tabWidth": 2,

现在 VS 代码以红色突出显示缩进字段。
VS 代码希望有 4 个空格。
如何在 VS 代码中设置 2 个空格?
或者我怎样才能在 VS 代码中删除这个红色突出显示?

【问题讨论】:

    标签: visual-studio-code prettier


    【解决方案1】:

    我找到了解决问题的方法!
    这是我的设置.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,
    

    【讨论】:

      猜你喜欢
      • 2022-07-23
      • 1970-01-01
      • 1970-01-01
      • 2023-01-17
      • 1970-01-01
      • 2015-06-30
      • 2016-03-20
      • 1970-01-01
      • 2023-02-14
      相关资源
      最近更新 更多