✅ The "extends": "plugin:ember/recommended"
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.
Use "Ember Data Packages" from Ember RFC #395.
The goal of this rule is to ease the migration to the new @ember-data packages.
ember-data has been split in multiple packages. For instance, its store is now released in "@ember-data/store" package. These packages have been released starting from ember-data version 3.11.
Examples of incorrect code for this rule:
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import DS from 'ember-data';
const { Model } = 'ember-data';
Examples of correct code for this rule:
import Model, { attr } from '@ember-data/model';
This rule implements a fix function (or to be more precise: it leverages the no-old-shims
fix function). If, as a user, you can get rid of all the import DS from "ember-data";
imports, you'll be able to use this rule fixer to complete the upgrade.
Note that a codemod is also available to complete the upgrade.
You don't want to use this rule if you're using ember-data@<3.11
.