HTMLHint icon indicating copy to clipboard operation
HTMLHint copied to clipboard

reading configuration file is broken for a long time

Open yilmazdurmaz opened this issue 5 years ago • 8 comments

Describe the bug seemingly working function, reading configuration from a file, is in fact broken. it simply does not not work.

To Reproduce

  • create a new html file, and fill base content with emmet (i use vscode).
  • now remove the title tag, and make a typo to closing body tag "bodx". 3 errors must be present.
  • create a config file and add {"title-require": true}. now only title error shows and tag match errors are gone.
  • use {"title-require": false} and no errors are present.
  • use {"title-require": false,} (trailing comma) and all errors are back
  • use arbitrary {"a":"a"} and {"a":"a",} (trailing comma) and see that previous 2 steps has nothing to do with what used inside

Expected behavior

  • a single rule change should not need trailing comma
  • a single rule change should not affect other default rules
  • an arbitrary input should not overwrite any default rule.

Screenshots

  • no screenshot needed, steps are clear

Desktop (please complete the following information):

  • OS: windows
  • Version 10 1909

Additional context from vscode

  • vscode: 1.41.1 and 1.47.1
  • HTMLHint extension v0.8.0 (htmlhint 0.11.0)

from terminal

  • Node: 12.14.1
  • htmlhint: 0.14.1

yilmazdurmaz avatar Jul 16 '20 14:07 yilmazdurmaz

Tested it with your changes in branch feat/add-config-attribute-extends and it seems to be fixed So I think this can be closed when we released the 1.0.0

Shinigami92 avatar Jul 16 '20 15:07 Shinigami92

"It will be closed if no further activity occurs"

closing a bug topic without a solution? is this some setting missing in the project's github settings or a behaviour of github in general?

yilmazdurmaz avatar Sep 15 '20 07:09 yilmazdurmaz

@Shinigami92 is there an estimate when v1.0 is coming? or anything to integrate the fix into current v0.x line?

yilmazdurmaz avatar Nov 14 '20 08:11 yilmazdurmaz

is this problem solved in v0.14.2? or still delayed for v1.0.0

yilmazdurmaz avatar Jan 13 '21 11:01 yilmazdurmaz

This is still an issue, please tag with keep-unstale.

polyzen avatar Sep 16 '21 21:09 polyzen

@thedaviddias, please re-open as well. :)

polyzen avatar Sep 17 '21 17:09 polyzen

still an issue, config is not loaded for URL linting, but loaded for local files

$ cat .htmlhintrc
{
    "attr-value-double-quotes": false
}

$ htmlhint google.com

   Config loaded: /home/ubuntu/.htmlhintrc

Scanned 0 files, no errors found (10 ms).

$ htmlhint https://google.com/

   https://google.com/
      L10 |})();</script><div id="mngb"><div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="https://ww...
                                            ^ The value of attribute [ id ] must be in double quotes. (attr-value-double-quotes)
      L10 |...ipt><div id="mngb"><div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="https://www.google.i...
                                                      ^ The value of attribute [ class ] must be in double quotes. (attr-value-double-quotes)

bkarlson avatar Oct 15 '21 13:10 bkarlson

Just had this issue and found a workaround. When supplying your own valid config, it seems to override the default values, meaning that all rules get disabled. To fix this, create a .htmlhintrc file and fill it in as follows:

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

After this you can modify/add/delete rules as you please.

KhafraDev avatar Jul 07 '23 03:07 KhafraDev