Skip to content

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

@ahemed-haneen

Description

@ahemed-haneen

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?

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