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

Add rel to list of sorted attributes #1297

Open
ivanperez-keera opened this issue Mar 19, 2023 · 0 comments
Open

Add rel to list of sorted attributes #1297

ivanperez-keera opened this issue Mar 19, 2023 · 0 comments
Labels
keep-unstale The issue will not be marked as stale by the stale-bot

Comments

@ivanperez-keera
Copy link

ivanperez-keera commented Mar 19, 2023

Is your feature request related to a problem? Please describe.

The rule attr-sorted complains about an order of attributes in links that is standard in HTML.

Details:

The rule attr-sorted does not know about rel, which is often used in links. For that reason, it expects it to appear after the attributes it knows about. The rule knows about href, so it complains that rel is before href.

However, it is very common for links to have the two attributes in the following order:

<link rel="RELATIONSHIP" href="URL">

For example:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">

Describe the solution you'd like
Make rel a known attribute in the rule attr-sorted, and expect it before href.

Describe alternatives you've considered
Disabling the rule.

Additional context
There are other attributes known by attr-sorted that apply to link, such as type and title: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link

The attribute rel also applies to other elements: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel

Is issue #1210 allowed for customization of not just the order, but also the attributes, then it would also provide an easy solution for this issue.

@stale stale bot added the bot:stale Issue marked as stale because there was no activity label May 20, 2023
@coliff coliff added keep-unstale The issue will not be marked as stale by the stale-bot and removed bot:stale Issue marked as stale because there was no activity labels May 21, 2023
@htmlhint htmlhint deleted a comment from stale bot May 22, 2023
@htmlhint htmlhint deleted a comment from ivanperez-keera May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-unstale The issue will not be marked as stale by the stale-bot
Projects
None yet
Development

No branches or pull requests

2 participants