Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 724 Bytes

File metadata and controls

40 lines (26 loc) · 724 Bytes

ember/no-legacy-computed

Disallow legacy computed properties and computed macros.

Rule Details

This rule disallows:

  • computed imported from @ember/object
  • Any import from @ember/object/computed (for example and, gt, sortBy, and other macros)

Use @tracked and native getters instead.

Examples

Examples of incorrect code for this rule:

import { computed } from '@ember/object';
import { and, gt, sortBy } from '@ember/object/computed';

Examples of correct code for this rule:

import { tracked } from '@glimmer/tracking';

class Example {
  @tracked count = 0;

  get doubled() {
    return this.count * 2;
  }
}