Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.34 KB

File metadata and controls

55 lines (37 loc) · 1.34 KB

ember/template-no-link-to-tagname

💼 This rule is enabled in the 📋 template-lint-migration config.

Disallow tagName attribute on LinkTo component

Rule Details

The tagName attribute on <LinkTo> components is deprecated. Use the appropriate HTML element or component instead.

Examples

Examples of incorrect code for this rule:

<template>
  <LinkTo @route="index" tagName="button">Home</LinkTo>
</template>
<template>
  <LinkTo @route="about" @tagName="span">About</LinkTo>
</template>

Examples of correct code for this rule:

<template>
  <LinkTo @route="index">Home</LinkTo>
</template>
<template>
  <button type="button" {{on "click" (fn this.transitionTo "index")}}>Home</button>
</template>

Migration

  • Remove the tagName overrides and, if you need it, adjust the styling of the <a> elements to make them look like buttons

Related rules

References