miragejs / ember-cli-mirage

An Ember Addon to easily add Mirage JS to your Ember app.
http://ember-cli-mirage.com
MIT License
863 stars 441 forks source link

Memory Leak codemod is suggesting some changes in mirage files #2573

Open ahemed-haneen opened 7 months ago

ahemed-haneen commented 7 months ago

Bug or question

import { Factory } from 'miragejs';

export default Factory.extend({
    name: 'new Resource',
    description: null,
    status: 'active',
    createdTime: new Date(),
    lastModifiedTime: new Date(),
    relatedItems: [
            'a', 'b', 'c', 'd'
    ],
});

is getting updated when running

pnpm dlx ember-memory-leaks-codemod prototype-reference-leaks mirage/

to

import { Factory } from 'miragejs';

export default Factory.extend({
        name: 'new Resource',
    description: null,
    status: 'active',
    createdTime: new Date(),
    lastModifiedTime: new Date(),

    init() {
                this._super(...arguments);
        this.relatedItems = [
                        'a', 'b', 'c', 'd'
        ];
    },
});

is this a valid case or is the codemod raising a false alarm?