Rules are silently ignored if not valid JavaScript
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 474
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
Describe the bug
Upon writing custom rules, we often encounter that HTMLHint does not notify us about broken rules.
To Reproduce
- Define a custom rule like
module.exports = HTMLHint > {
};
Expected behavior
Like in https://github.com/htmlhint/HTMLHint/issues/662 it is expected, that at least some warning is shown, which rule could not be loaded.
Additional context
The result is to be expected due to catching all errors regarding rule imports and ignoring them: https://github.com/htmlhint/HTMLHint/blob/e147134aa3237273e0d1daf19e201c60e7af5a4f/src/cli/htmlhint.ts#L210
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/cli/htmlhint.ts around line 210, where errors from custom rule imports are caught, and review the related behavior described in issue #662. The work is done when an invalid JavaScript rule produces a visible warning identifying that the rule could not be loaded instead of being silently ignored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100