You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding the location of the parsed file in the start-event #1317
Is your feature request related to a problem? Please describe.
Introducing HTMLHint to legacy code is quite tricky. You can either disable all failing rules or ignore the file for all HTMLHint rules.
It is impossible to implement a ratcheting system where I can prevent new commits from having faults while systematically ignoring the existing faults.
This is especially the case for custom rules, where very specific problems can be detected at a very late stage and require huge amounts of labor to fix.
Describe the solution you'd like
There must be some way to retrieve the currently parsed source code location.
With that one can add an ignored source code location list to each of the rules and ignore the specific pages.
Currently the start-event looks like this:
{pos: 0,line: 1,col: 1,type: 'start'}
Adding the source code location would allow that implementation:
I tried checking every event if they contain such information but nothing was found.
I am unaware of any Node.js specific function or object to retrieve that information,
which file HTMLHint is currently working on.
sorry for not replying sooner! I'm not too much in favour of adding this feature (as in, I don't think I'd use it myself), but if this introduces only small changes and doesn't affect how it works for anyone not using the feature then I might be okay with adding it. You are welcome to submit a PR. Thanks for your time!
Activity
commodis commentedon Jan 16, 2025
I just read through the source code and noticed a potential path:
HTMLHint/src/cli/htmlhint.ts
Line 462 in a581644
HTMLHint/src/core/htmlparser.ts
Line 81 in a581644
Is that a feasible solution? I do not see any problems with that. I could submit a PR if it is wished.
commodis commentedon Apr 20, 2026
@coliff is the above mentioned solution feasible? I do not see any problems with that. I could submit a PR if it is wished.
coliff commentedon May 14, 2026
sorry for not replying sooner! I'm not too much in favour of adding this feature (as in, I don't think I'd use it myself), but if this introduces only small changes and doesn't affect how it works for anyone not using the feature then I might be okay with adding it. You are welcome to submit a PR. Thanks for your time!
Closes htmlhint#1317: Add filepath to the start event
Closes htmlhint#1317: Add filepath to the start event
Closes htmlhint#1317: Add filepath to the start event
Closes htmlhint#1317: Add filepath to the start event
Closes htmlhint#1317: Add filepath to the start event