eslint-plugin-ember icon indicating copy to clipboard operation
eslint-plugin-ember copied to clipboard

ember/template-no-let-reference

Open amk221 opened this issue 1 year ago • 9 comments

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>);
});

amk221 avatar Jan 29 '24 20:01 amk221

Is it ok to disable this rule in tests?

yea, I'd say so.

NullVoxPopuli avatar Jan 29 '24 21:01 NullVoxPopuli

@bmish should we have a config for tests?

NullVoxPopuli avatar Jan 30 '24 13:01 NullVoxPopuli

Re-opening, as this could affect many

NullVoxPopuli avatar Jan 30 '24 13:01 NullVoxPopuli

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.

bmish avatar Jan 30 '24 13:01 bmish