eslint-plugin-ember
eslint-plugin-ember copied to clipboard
fix: ignore mirage directory for avoid-leaking-state-in-ember-objects
Unsure if this is the right approach for mirage.. but I thought I'd see what others think 💭
This code in mirage..
import { Factory } from 'ember-cli-mirage'
export default Factory.extend({
foo: []
})
..has the same issues as the similar code in ember that this rule is trying to prevent..
export default Foo.extend({
items: [],
});
..but the consequences aren't as bad, as mirage isn't normally run in production.
Though there is still the risk of leaking state in tests?
Fixes #202 Fixes #214
I'd like to get @rwjblue's opinion on this.
Suggestion - gate this behind a config flag? Maybe default to true is fine.
We've run into leaking state in tests plenty of times. Granted we've got ~4k tests running very split in ember exam, so some of that's on us 😢. Not currently using mirage, but I would think some teams would like to be able to config this if they do have test leak problems.