💼 This rule is enabled in the ✅ recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
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.
For TypeScript users, imports from ember-data/types/registries/*
are still allowed since there is currently no equivalent in the new packages.
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
.