Skip to content

Add rel to list of sorted attributes  #1297

@ivanperez-keera

Description

@ivanperez-keera

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.

Metadata

Metadata

Assignees

Labels

keep-unstaleThe issue will not be marked as stale by the stale-bot

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions