✅ The extends: 'recommended'
property in a configuration file enables this rule.
Ember has a runtime warning that says:
Binding style attributes may introduce cross-site scripting vulnerabilities; please ensure that values being bound are properly escaped.
This warning can only be avoided by marking the bound value with Ember.String.htmlSafe
. While we can't always detect statically if you're providing a safe string, we can detect and forbid common cases where it's impossible that you're doing so.
Common cases which do not propagate htmlSafe
include:
- Implied string concatenation using quotes
- The
concat
helper
This rule forbids the following:
This rule allows the following:
- See the Binding Style Attributes Ember deprecation documentation
- See the documentation for Ember's
htmlSafe
function - See the documentation for Ember's
concat
handlebars template helper - See the documentation for the
html-safe
handlebars template helper from theember-cli-string-helpers
addon