-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
HTMLHint: Change type to anyOf for attributes in htmlhint.json #5263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These rules accept boolean OR am array. - https://htmlhint.com/rules/attr-lowercase/ - https://htmlhint.com/rules/attr-value-no-duplication/
|
Thanks for the PR! This section of the codebase is owned by @madskristensen and |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the HTMLHint schema to allow two rules (attr-lowercase and attr-value-no-duplication) to accept either boolean or array types, matching their actual behavior in HTMLHint.
- Changed
attr-lowercaseandattr-value-no-duplicationfrom boolean-only to accepting boolean or array types usinganyOf - This aligns the schema with HTMLHint's actual API where these rules can accept arrays of attribute names
Comments suppressed due to low confidence (1)
src/schemas/json/htmlhint.json:43
- The array type definition is incomplete. According to the HTMLHint documentation, the array should contain attribute names as strings. Add an items schema to specify that array elements should be strings.
"attr-value-not-empty": {
"description": "Attribute must set value.",
"type": "boolean",
"default": false
| "anyOf": [{ "type": "boolean" }, { "type": "array" }], | ||
| "default": false | ||
| }, | ||
| "attr-no-duplication": { |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array type definition is incomplete. According to the HTMLHint documentation, the array should contain attribute names as strings. Add an items schema to specify that array elements should be strings.
| "anyOf": [{ "type": "boolean" }, { "type": "array" }], | ||
| "default": false | ||
| }, | ||
| "attr-no-duplication": { |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage should be added for the new array type functionality. The existing test file only covers boolean values. Add test cases showing the array usage for both attr-lowercase and attr-value-no-duplication rules.
|
@coliff is this ready to merge? |
|
Yes, I believe so. Thanks |
|
Thanks |
These rules accept boolean OR an array.