Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ahemed-haneen opened this issue Jan 15, 2024 · 0 comments
Open

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

ahemed-haneen opened this issue Jan 15, 2024 · 0 comments

Comments

@ahemed-haneen
Copy link

ahemed-haneen commented Jan 15, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant