Skip to content

Rule Change: Make no-html rule's allowed option case-insensitive #479

@TKDev7

Description

@TKDev7

What rule do you want to change?

no-html

What change do you want to make?

Generate fewer warnings

How do you think the change should be implemented?

A new default behavior

Example code

<div></div>
<DIV></DIV>

What does the rule currently do for this code?

Currently, if allowed: ["DIV"] is configured, the rule will correctly allow <DIV></DIV>. However, <div></div> will be reported as an error because the matching is case-sensitive. This leads to false positives since HTML tags are, by specification, case-insensitive.

What will the rule do after it's changed?

After this change, the no-html rule will perform case-insensitive matching when checking HTML tag names against the allowed option list. This means that if allowed: ["DIV"] is configured, both <div></div> and <DIV></DIV> (and any other casing like <DiV>) will be correctly recognized as allowed and will not be reported as errors.

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Implementing

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions