avajs/eslint-plugin-ava




Do you want to work on this issue?
You can request for a bounty in order to promote it!
Prevent specifying error type in `t.notThrows()` #178
sindresorhus posted onGitHub
It's an easy mistake to make if you have many t.throws()
statements and then some t.notThrows()
statements.
For example: https://github.com/sindresorhus/p-queue/commit/80e8e25926a6632d0429ebb526ee78a68f01d565
// Fail
t.notThrows(() => {
t.pass();
}, TypeError);
// Ok
t.notThrows(() => {
t.pass();
});
It should fail if it's a variable matching this regex: /^(?:[A-Z][a-z0-9]*)*Error$/