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

Allow different patterns for the `t.try()` callback argument

Open novemberborn opened this issue 6 years ago • 2 comments

https://github.com/avajs/ava/pull/1947 landed a new t.try() assertion. It's experimental, one of the reasons for which is that it advocates some new usages of AVA that this plugin rejects.

t.try() takes a callback, which receives another execution object:

const attempt = await t.try(t => {
  t.pass()
})

attempt.commit()

Not all linting setups allow you to shadow variables like this. I'm proposing we also allow tt, and t1 through t9. Thoughts?

novemberborn avatar Sep 15 '19 17:09 novemberborn

I would also allow t_. I usually postfix with underscore for shadowed variables with the same name.

sindresorhus avatar Sep 15 '19 17:09 sindresorhus

Yes. Looks like you're agreed with the other patterns so then we need to add support for all of these.

novemberborn avatar Sep 15 '19 17:09 novemberborn