【问题标题】:VS Code Squiggle line in HTML and CSS filesHTML 和 CSS 文件中的 VS Code Squiggle 行
【发布时间】:2021-11-01 19:18:21
【问题描述】:

一周前我将 VS Code 更新为版本:1.61.2,我开始注意到我的 CSS 文件中出现了一些错误和警告波浪线。我已经在这个项目上工作了很长一段时间,但这些最近才开始出现。\

VS Code 如何计算和显示这些错误/警告行以及如何控制这些设置?

少数示例错误类别是 - compact-api/htmlcompact-api/csscss-prefix-order

  • Firefox、Firefox for Android、Internet Explorer、Opera、Safari compact-api/html) 不支持“meta[name=theme-color]”
  • “transition”应该列在“-moz-transition”之后(css-prefix-order
  • Internet Explorer 不支持“显示:网格”。添加 'display: -ms-grid' 以支持 Internet Explorer 10+ (compact-api/css)

Sample Screenshot:

【问题讨论】:

    标签: visual-studio-code vscode-settings


    【解决方案1】:

    它的https://docs.microsoft.com/en-us/microsoft-edge/visual-studio-code/webhint

    {
      "vscode-edge-devtools.webhint": false
    }
    

    【讨论】:

    • 谢谢@Nermo。您是否碰巧知道这是否是一项新功能?当我用谷歌搜索它时,它看起来并不老。但我注意到这些是最近在我的项目中启动的。
    • 我还发现了这篇关于webhint in VS Code 和相关扩展的文章。这篇文章是 6 个月前发表的,所以我认为这是 VS Code 中相对较新的特性。
    【解决方案2】:

    我禁用了 Microsoft Edge Tools for VS Code,警告消失了。

    【讨论】:

      【解决方案3】:

      如果您想保留 linting 功能但看不到那些与 Internet Explorer 相关的错误,可以通过创建一个带有如下条目的 hintrc 文件来删除它们:

      {
        "extends": ["development"],
        "browserslist": ["defaults", "not IE 11"]
      }
      

      例如,它不再检查与 IE11 的兼容性。

      在此处查看更多信息:https://stackoverflow.com/a/70676598/836330

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-09-27
        • 2019-11-18
        • 1970-01-01
        • 2020-04-01
        • 2018-06-09
        • 2021-10-21
        • 1970-01-01
        • 2020-01-14
        相关资源
        最近更新 更多