Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 1.07 KB

no-unnecessary-concat.md

File metadata and controls

42 lines (25 loc) · 1.07 KB

no-unnecessary-concat

💅 The extends: 'stylistic' property in a configuration file enables this rule.

🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

This rule forbids unnecessary use of quotes ("") around expressions like {{myValue}}.

Examples

This rule forbids the following:

<span class="{{if errors.length 'text-danger' 'text-grey'}}">

<img src="{{customSrc}}" alt="{{customAlt}}">

<label for="{{concat elementId "-date"}}">

This rule allows the following:

<span class={{if errors.length 'text-danger' 'text-grey'}}>

<img src={{customSrc}} alt={{customAlt}}>

<label for={{concat elementId "-date"}}>

Migration

Use regexp find-and-replace to fix existing violations of this rule:

Before After
="{{([^}]+)}}" ={{$1}}

References