Skip to content
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

attr-sorted doesn't sort unknown tags #661

Open
chrisguttandin opened this issue Jun 17, 2021 · 1 comment · May be fixed by #668
Open

attr-sorted doesn't sort unknown tags #661

chrisguttandin opened this issue Jun 17, 2021 · 1 comment · May be fixed by #668
Labels
bug Functionality that does not work as intended/expected keep-unstale The issue will not be marked as stale by the stale-bot

Comments

@chrisguttandin
Copy link

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.

@stale stale bot added the bot:stale Issue marked as stale because there was no activity label Aug 16, 2021
chrisguttandin added a commit to chrisguttandin/HTMLHint that referenced this issue Aug 16, 2021
Previously unknown attributes were just ignored. Now they get sorted alphabetically.

BREAKING CHANGE: HTMLHint will now throw an error if unkown attributes are not sorted.

fix htmlhint#661
@chrisguttandin
Copy link
Author

I went ahead and created a PR to make sure this doesn't get stale. :-) I chose to update the existing attr-sorted rule. Please let me know if I should better create a new rule.

@stale stale bot removed the bot:stale Issue marked as stale because there was no activity label Aug 16, 2021
@thedaviddias thedaviddias added the keep-unstale The issue will not be marked as stale by the stale-bot label Sep 11, 2021
@htmlhint htmlhint deleted a comment from stale bot Sep 14, 2022
@coliff coliff added the bug Functionality that does not work as intended/expected label Sep 14, 2022
chrisguttandin added a commit to chrisguttandin/HTMLHint that referenced this issue May 12, 2023
Previously unknown attributes were just ignored. Now they get sorted alphabetically.

BREAKING CHANGE: HTMLHint will now throw an error if unkown attributes are not sorted.

fix htmlhint#661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality that does not work as intended/expected keep-unstale The issue will not be marked as stale by the stale-bot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants