Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 1.19 KB

File metadata and controls

38 lines (23 loc) · 1.19 KB

ember/template-no-valueless-arguments

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

Similar to HTML attributes, component arguments will default to an empty string when they are not explicitly assigned a value. This behavior isn't documented anywhere so depending on it isn't recommended and usually the result of a user-error. Since it is valid syntax, accidental use of this behavior can be hard to detect and cause confusing bugs.

Examples

This rule forbids the following:

<template><Editor @defaultText /></template>
<template><SomeComponent @valuelessByAccident{{@canBeAModifier}} /></template>

This rule allows the following:

<template><Editor @defaultText="" /></template>

Migration

Explicitly assign a value to all arguments.

Related Rules

References