Skip to content

no-legacy-imports autofixer sometimes uses the wrong package replacements #10525

@Windvis

Description

@Windvis

I just ran the no-legacy-imports autofixer in our 6.12 classic project and noticed that it doesn't use the correct replacement for some packages.

In our app, both the JSONAPISerializer and Adapter were replaced with the wrong import.

- import JSONAPIAdapter from '@ember-data/adapter/json-api';
+ import JSONAPIAdapter from '@warp-drive/legacy/model';

While it should have been the following instead:

- import JSONAPIAdapter from '@ember-data/adapter/json-api';
+ import { JSONAPIAdapter } from '@warp-drive/legacy/adapter/json-api';

It looks like the mapping file is simply incorrect for these entries (and potentially others):

{
"filePath": "packages/adapter/src/json-api.ts",
"module": "@ember-data/adapter/json-api",
"export": "default",
"typeOnly": false,
"replacement": {
"module": "@warp-drive/legacy/model",
"export": "default",
"sourceFile": "warp-drive-packages/legacy/src/model.ts",
"typeOnly": false
}
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions