Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.13 KB

no-class-bindings.md

File metadata and controls

51 lines (33 loc) · 1.13 KB

no-class-bindings

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

It is possible to pass classBinding and classNameBindings as arguments to a component when invoked with curly syntax.

{{some-component classNameBindings="foo:truthy:falsy"}}

These arguments are merged into the class attribute, whether or not the component is a classic component (which contains the classNameBindings logic).

This rule disallows use of classBinding or classNameBindings on components.

Examples

This rule forbids the following:

{{some-thing classBinding="lol"}}no
<SomeThing @classBinding="lol" />
{{some-thing classNameBindings="lol:foo:bar"}}
<SomeThing @classNameBindings="lol:foo:bar" />

This rule allows the following:

{{some-thing}}
<SomeThing />

Migration

  • find in templates and remove classBinding and/or classNameBindings.

References