Skip to content

Enhancement: Improve validation of arrays inside .htmlhintrc #352

@gian1200

Description

@gian1200

Description

As explained in #287 (comment), validation of attr-value-no-duplication and attr-lowercase do not include element types inside the arrays.

Image

Suggestion

Reading https://stackoverflow.com/questions/77071094/json-schema-allow-multiple-types-in-array-while-specifying-the-order-and-amount, I think this could be done to solve it:

"attr-lowercase": {
    "description": "Attribute name must be lowercase.",
    "anyOf": [
        { "type": "boolean" },
        { "type": "array", "items": { "type": "string" } }],
    "default": false
},
...
"attr-value-no-duplication": {
    "description": "Class attributes should not contain duplicate values. Other attributes can be checked via configuration.",
    "anyOf": [
        { "type": "boolean" },
        { "type": "array", "items": { "type": "string" } }],
    "default": false
},

Place to change

https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/htmlhint.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions