Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support excluding directories #12

Open
ghost opened this issue Nov 10, 2015 · 5 comments
Open

Support excluding directories #12

ghost opened this issue Nov 10, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Nov 10, 2015

Hello,

I'd like to run htmllint on my project. However, running htmllint **/*.html gives a lot of false positives since it lints also the HTML files of the project dependencies stored in ./node_modules. The only workaround I can think of is to list all the directories (e.g. foo/**/*.html, bar/**/*.html) and the top-level HTML files (i.e. *.html). But with this approach, there is a big chance that I'll forget to add a newly created directories in the future and I won't notice that they are not linted.

It would be nice if there was a way to list directories/globs that should be excluded (like what you can do with .gitignore).

@ghost
Copy link
Author

ghost commented Jan 2, 2016

OK, I don't need this any more (an extended glob pattern is enough in my case). But maybe someone else does...

@kevincolten
Copy link

kevincolten commented Apr 10, 2017

@radek-holy What's the glob pattern you used?

I ended up having to fork the repo to hard ignore file names containing node_modules in a pinch
kevincolten@5901ac1

and having to run htmllint {*.html,./**/*.html}

@Nxt3
Copy link

Nxt3 commented Nov 16, 2017

You can just do htmllint $(find /directories /you /want /to /search -name '*.html)

I avoid node_modules like this: htmllint $(find /app -name '*.html)

@dietergeerts
Copy link

Any plans on including the possibility to use .gitignore? eslint and stylelint have the option

@iansantagata
Copy link

iansantagata commented Oct 13, 2021

Late to the party, but for anyone looking for a static glob pattern without having to use find and if your node_modules are in the root repository, you can do this:

htmllint {,!(node_modules)/**/}*.html

Would be nice if this could be supported by a feature like --ignore-path <path> similar to ESLint though.

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

No branches or pull requests

4 participants