htmlhint / htmlhint/HTMLHint

Rules are silently ignored if not valid JavaScript

Open
#1,035 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug keep-unstale
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

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.