流星打字稿抱怨vscode中缺少文档类型 [英] Meteor typescript complaining about missing doctype in vscode

查看:596
本文介绍了流星打字稿抱怨vscode中缺少文档类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VSCode抱怨html文件上缺少DOCTYPE.流星构建系统会自动添加文件类型,使用它们会导致构建错误.如何使vscode忽略html文件上缺少的文档类型?

VSCode is complaining about missing DOCTYPE on the html files. Meteor build system automatically adds file types and having them causes build errors. How do I make vscode to ignore missing doctype on html files?

我得到这个错误.

Doctype must be declared first.

推荐答案

您需要在根文件夹中创建.htmlhintrc

you need to create a .htmlhintrc in your root folder

您可以转到 http://htmlhint.com/并设置适合您的规则,创建.htmlhintrc

you can go to http://htmlhint.com/ and setup the rules that are convient to you and create the .htmlhintrc

这是"doctype-first": false,的示例,如果这是您的目标,它将忽略您收到的错误.

here is an example with "doctype-first": false,, which would ignore the error you're receiving, if that's your goal.

{
  "tagname-lowercase": true,
  "attr-lowercase": false,
  "attr-value-double-quotes": true,
  "doctype-first": false,
  "tag-pair": true,
  "spec-char-escape": true,
  "id-unique": true,
  "src-not-empty": true,
  "attr-no-duplication": true,
  "title-require": true
}

这篇关于流星打字稿抱怨vscode中缺少文档类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆