Skip to content

Configuration not found when using the CLI #190

Open
@sinedied

Description

@sinedied

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?

Activity

mitorez

mitorez commented on Jan 31, 2017

@mitorez

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
ianwalter

ianwalter commented on Feb 1, 2017

@ianwalter

@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?

mitorez

mitorez commented on Feb 1, 2017

@mitorez

@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.

ianwalter

ianwalter commented on Feb 1, 2017

@ianwalter

@mitorez Do you mean .htmlhintrc? Or did you name it incorrectly?

mitorez

mitorez commented on Feb 1, 2017

@mitorez

@ianwalter You had me second-guessing myself there for a second 😉 That was a typo on my part. My configuration file is named correctly (.htmlhintrc) at the project root.

sinedied

sinedied commented on May 4, 2017

@sinedied
Author

On windows platforms, .htmlhintrc is not found whatever I try.

htmlhint src or htmlhint ./src fails, but htmlhint src --config .htmlhintrc works.

mitorez

mitorez commented on May 5, 2017

@mitorez

This has been working for me on Windows: htmlhint src/**/*.html --config .htmlhintrc

sinedied

sinedied commented on May 5, 2017

@sinedied
Author

@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.

stale

stale commented on May 14, 2020

@stale
added
bot:staleIssue marked as stale because there was no activity
on May 14, 2020
sinedied

sinedied commented on May 15, 2020

@sinedied
Author

Not sure using a stale bot will help resolution ongoing bugs :/

removed
bot:staleIssue marked as stale because there was no activity
on May 15, 2020
stale

stale commented on Jul 14, 2020

@stale

7 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR neededbugFunctionality that does not work as intended/expectedkeep-unstaleThe issue will not be marked as stale by the stale-bot

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ianwalter@thedaviddias@sinedied@mitorez@Shinigami92

        Issue actions

          Configuration not found when using the CLI · Issue #190 · htmlhint/HTMLHint