Configuration not found when using the CLI
I have a strange behavior with the CLI and configuration file.
I have a .htmlhintrc file at the root of my project.
When I run htmlhint src, it finds the config file and correctly lint my html files, but when I run htmlhint src/**/*.html I have an error saying that the configuration is not found?
I have a similarly related issue.
I don't receive an error that the configuration wasn't found, but if I run htmlhint src/*.html src/**/*.html it doesn't use my .htmlhintrc file - it's using "something else", maybe the built-in defaults. If I run htmlhint src/*.html src/**/*.html --config .htmlhintrc it works as expected.
This was literally working last week. HTMLHint hasn't been updated, still using htmlhint 0.9.13, but I did do a fresh install of my project this week so dependencies have been updated. I'm not sure how to troubleshoot the issue, so I'm continuing to specify --config.
Environment:
- Windows 8.1
- nvm-windows 1.1.1
- Node.js 6.9.4
- npm 3.10.10
- htmlhint 0.9.13
@mitorez You could do htmlhint ./src/**/*.html adding the ./ fixes the issue for me. Should we just add some code that prepends it to base in the getConfig function?
@ianwalter Unfortunately pre-pending ./ didn't work for me. I ran htmlhint ./src/*.html ./src/**/*.html just now and it still failed to load the ~~.htmlhint~~ .htmlhintrc at the root of the project.
@mitorez Do you mean .htmlhintrc? Or did you name it incorrectly?
@ianwalter You had me second-guessing myself there for a second :wink: That was a typo on my part. My configuration file is named correctly (.htmlhintrc) at the project root.
On windows platforms, .htmlhintrc is not found whatever I try.
htmlhint src or htmlhint ./src fails, but htmlhint src --config .htmlhintrc works.
This has been working for me on Windows: htmlhint src/**/*.html --config .htmlhintrc
@mitorez yes using the --config option works, but it misses the point.
You shouldn't have to add this option in the first place, that's the issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Not sure using a stale bot will help resolution ongoing bugs :/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This bot is annoying 😒
What's the status on this? I seem to be facing the same issue. It doesn't seem to work even with the config option. Is there some issue with the config file?
{
"alt-require" : true,
"attr-lowercase" : true,
"attr-sorted" : true,
"attr-no-duplication" : true,
"attr-unsafe-chars" : true,
"attr-value-double-quotes" : true,
"attr-value-not-empty" : true,
"attr-value-single-quotes" : false,
"attr-whitespace" : true,
"doctype-first" : true,
"doctype-html5" : true,
"head-script-disabled" : false,
"href-abs-or-rel" : false,
"html-lang-require" : true,
"id-class-ad-disabled" : true,
"id-class-value" : underline,
"id-unique" : true,
"inline-script-disabled" : true,
"inline-style-disabled" : true,
"input-requires-label" : true,
"script-disabled" : false,
"space-tab-mixed-disabled" : space,
"spec-char-escape" : true,
"src-not-empty" : true,
"style-disabled" : true,
"tag-pair" : true,
"tag-self-close" : true,
"empty-tag-not-self-closed" : false,
"tagname-lowercase" : true,
"tagname-specialchars" : true,
"title-require" : true,
"tags-check" : true,
"attr-no-unnecessary-whitespace" : true
}
The file resides in the repository https://github.com/linusjf/LearnHTML5
The htmlhint version is 1.1.4.