Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor typescript complaining about missing doctype in vscode

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?

Error I get for this.

Doctype must be declared first.
like image 229
Kimmo Hintikka Avatar asked Jun 29 '16 22:06

Kimmo Hintikka


2 Answers

you need to create a .htmlhintrc in your root folder

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

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
}
like image 67
Sebastian Castaldi Avatar answered Oct 26 '22 20:10

Sebastian Castaldi


Go to your VScode Preferences > Settings > HTML-Hint and add this:

"htmlhint.options": { "doctype-first": false }

like image 23
André Bueno Avatar answered Oct 26 '22 22:10

André Bueno