Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.06 KB

no-volatile-computed-properties.md

File metadata and controls

39 lines (28 loc) · 1.06 KB

no-volatile-computed-properties

✅ The "extends": "plugin:ember/recommended" property in a configuration file enables this rule.

Volatile computed properties are deprecated as of Ember 3.9.

Rule Details

This rule disallows using volatile computed properties.

Examples

Examples of incorrect code for this rule:

const Person = EmberObject.extend({
  fullName: computed(function () {
    return `${this.firstName} ${this.lastName}`;
  }).volatile()
});

Examples of correct code for this rule:

const Person = EmberObject.extend({
  // Native getter:
  get fullName() {
    return `${this.firstName} ${this.lastName}`;
  }
});

References