Skip to content

attr-sorted doesn't sort unknown tags #661

Open
@chrisguttandin

Description

Is your feature request related to a problem? Please describe.
The attr-sorted rule sorts a couple of known tags but doesn't care about those which are not on the list.

Describe the solution you'd like
I think it would be great if all tags would be sorted in a reproducible manner. Tags which are not on the list could for example be sorted alphabetically.

Currently both versions of the custom-element below pass the rule.

<custom-element custom-a="a" custom-b="b" />
<custom-element custom-b="b" custom-a="a" />

I think it would be better if there was only one correct way to write this. When sorting other tags alphabetically that would be:

<custom-element custom-a="a" custom-b="b" />

Describe alternatives you've considered
It would be possible as well to create a completely new rule which sorts all tags alphabetically.

Additional context
I'm happy to provide a PR if you think this is a useful addition to HTMLHint.

Metadata

Assignees

No one assigned

    Labels

    bugFunctionality that does not work as intended/expectedkeep-unstaleThe issue will not be marked as stale by the stale-bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions