在 VS Code 和 Atom 中启用实时 HTML 验证

Enabling realtime HTML validation in VS Code and Atom

我很难找到如何在其中任何一个中执行此操作。我原以为它会是内置的,就像在 VS Studio 中一样;如果标签未关闭,则会出现卷曲下划线作为警告。
顺便说一句,JS 和 CSS 代码似乎在 Code 和 Atom 中都经过了本地验证。那为什么不 HTML?

PS:即使 Notepad++ 在标签未关闭时也会抱怨..

至少在 Atom 中,默认情况下不会验证任何内容。您需要为要验证的语言安装 linter(通常称为 linted)。

一个流行的 linter 是同名的 Atom 包 – linter. Once installed, you need additional providers for the syntax you want to lint. All available providers are listed on the AtomLinter website, including HTML, CSS and JavaScript.

至于 Visual Studio 代码,您可以从他们的 marketplace.

安装各种 linters

对于Visual Studio代码,可以使用HTMLHint extension, which integrates the HTMLHint静态分析工具转化为VSCode。