ember-cli / eslint-plugin-ember

An ESLint plugin that provides set of rules for Ember applications based on commonly known good practices.
MIT License
257 stars 198 forks source link

ember/template-no-let-reference #2078

Open amk221 opened 5 months ago

amk221 commented 5 months ago

Is it ok to disable this rule in tests? This is a contrived test case

let someThing;

hooks.beforeEach(function (assert) {
  someThing = null;
});

test('foo', async function (assert) {
  someThing = 'foo'

  await render(<template>
    <MyComponent @arg={{someThing}} />
  </template>);
});

test('bar', async function (assert) {
  someThing = 'bar'

  await render(<template>
    <MyComponent @arg={{someThing}} />
  </template>);
});
NullVoxPopuli commented 5 months ago

Is it ok to disable this rule in tests?

yea, I'd say so.

NullVoxPopuli commented 5 months ago

@bmish should we have a config for tests?

NullVoxPopuli commented 5 months ago

Re-opening, as this could affect many

bmish commented 5 months ago

I'm opposed to adding additional configs. I'd like everything to work properly with simply the recommended config. We have other rules that bail-out in test files.