htmlhint / HTMLHint

⚙️ The static code analysis tool you need for your HTML
https://htmlhint.com
MIT License
3.08k stars 380 forks source link

Allow negation ! for --ignore #1339

Open woodconn opened 1 year ago

woodconn commented 1 year ago

Your documentation shows how ignore can handle multiple file paths https://github.com/htmlhint/HTMLHint/blob/master/docs/user-guide/usage/options.md

However the negation command '!' is currently useless.

This means if I only want to search in a folder, I can't use

!**/GoodFolder/**

Instead I must manually ignore all other folders.

**/BadFolder1/**,......,**/BadFolder8889986767/**

I'd also be ok if you allowed a new rule that would filter paths that could be modified in .htmlhintrc

woodconn commented 1 year ago

Workaround, I found this to work as expected, however I don't know if I can feed it multiple paths like ignore is capable of: Run npx htmlhint "**/GoodFolder/**/*.razor"

stale[bot] commented 1 year ago

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.

hyperupcall commented 10 months ago

The glob package mentions that negation was removed in v6. HTMLHint currently uses glob v8.

globby supportgs negation, but I am not convinced it is worth switching. The user can supply multiple glob patterns as regular arguments to htmlhint. Furthermore, @babel/cli, npm, mocha, tslint, browserify, grunt, styelus, nyc, karma, etc. all use glob, so I think the user experience could be improved without changing how --ignored globs are parsed