Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

HTMLhint now complains about Doctype, ignores .htmlhintrc #22

Open
dbaeumer opened this issue Jan 18, 2017 · 4 comments
Open

HTMLhint now complains about Doctype, ignores .htmlhintrc #22

dbaeumer opened this issue Jan 18, 2017 · 4 comments

Comments

@dbaeumer
Copy link
Member

From @smlombardi on January 17, 2017 17:13

  • VSCode Version: Code - Insiders 1.9.0-insider (f67f87c5498d9361c0b29781c341fd032815314b, 2017-01-17T07:04:34.904Z)
  • OS Version: Darwin x64 16.3.0
  • Extensions:
Extension Author Version
material-icon-theme PKief 1.2.0
code-settings-sync Shan 2.4.2
sort-lines Tyriar 1.1.0
html-css-class-completion Zignd 1.0.3
Bookmarks alefragnani 0.10.2
project-manager alefragnani 0.13.0
vscode-angular-files alexiv 1.3.7
one-monokai azemoh 0.2.4
vscode-icontheme-nomo-dark be5invis 1.2.5
vscode-eslint dbaeumer 1.2.2
githistory donjayamanne 0.1.5
tslint eg2 0.8.1
vscode-great-icons emmanuelbeziat 1.1.38
Angular2 johnpapa 1.0.2
theme-karyfoundation-themes karyfoundation 10.3.0
ftp-sync lukasz-wronski 0.3.2
HTMLHint mkaufman 0.3.3
vscode-csscomb mrmlnc 4.0.0
vscode-postcss-sorting mrmlnc 2.2.0
vscode-stylefmt mrmlnc 2.2.2
Theme-1337 ms-vscode 0.1.2
angular2-inline natewallace 0.0.17
nonbreakingspace smlombardi 0.0.1
vscode-icons robertohuertasm 7.0.1
stylelint shinnn 0.21.2
darcula-extended smlombardi 3.2.0
theme-tesla smlombardi 6.0.0
change-case wmaurer 1.0.0

Steps to Reproduce:

Prior to the most recent Insiders update I did not have this issue

  1. open an html file fragment, e.g. code meant to be used as an include or an AngularJS view, which has no Doctype, html, head or body tags
  2. gives you a warning:
    screen shot 2017-01-17 at 12 08 49 pm

My project has an .htmlhintrc file which says not to apply this rule:

{
    "tagname-lowercase": true,
    "attr-lowercase": ["viewBox", "test"],
    "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,
    "style-disabled": false
}

But I get the error anyway.

Copied from original issue: microsoft/vscode#18678

@warent
Copy link

warent commented Nov 18, 2017

Any plans on fixing this? It's making the extension unusable for me since I'm editing templates within Vue components

EDIT:
I found a workaround, just add the rules manually in your vscode settings

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

Less than ideal but at least it's usable now :)

@dreamalligator
Copy link

I get this same issue, but I'm just using the CLI fyi. Likely an issue upstream with htmlhint 👍

@Sarabadu
Copy link

Sarabadu commented Jan 9, 2020

@amin125 you need to set all the options
"htmlhint.options": { "tagname-lowercase": true, "attr-lowercase": true, "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 },

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@Sarabadu @dbaeumer @dreamalligator @warent and others