Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.15 KB

no-invalid-link-title.md

File metadata and controls

34 lines (21 loc) · 1.15 KB

no-invalid-link-title

✅ The extends: 'recommended' property in a configuration file enables this rule.

The title attribute is a useful way to give users extra context for a link. However, this content should be complementary content and should not be exactly the same as or part of the link text.

This rule checks links for the presence of a title attribute and ensures that it is not the same as or part of the link text.

Examples

This rule forbids the following:

<a href="https://mytutorial.com" title="read the tutorial">Read the Tutorial</a>
<a href="https://mytutorial.com" title="Tutorial">Read the Tutorial</a>

This rule allows the following:

<a href="https://mytutorial.com" title="New to Ember? Read the full tutorial for the best experience">Read the Tutorial</a>,

Migration

  • If the title attribute value is the same as or part of the link text, it's better to leave it out.

References