eslint-plugin-ava
eslint-plugin-ava copied to clipboard
Agnostic of assertion object name?
A lot of the rules have hardcoded t as the assertion library name, meaning two things:
- If the dev uses another name for
t, such asassert, rules dealing with it will not lint anything - If the dev uses another name for
t, and usestfor something else in the test function, the linter may go haywire.
I've seen a related issue in AVA's issues. I think we should either of the following:
- Add a note in the README saying that
tshould be used, and why, including the fact that this plugin depends on it heavily, and the reasons that maketgreat when used in AVA (power-assert) (cc @twada). The description of theuse-trule should be updated too. - Make the rules
t-agnostic. Most of the work would probably be done increate-ava-ruleand then simple updates in the rest of the rules + tests covering.
They really should just be using t to get power-assert goodness.
It would be nice to (better) document why it needs to be named t then.
:+1: for ensuring documentation is clear on the t naming requirement.
Until we can allow any argument name IMO this plugin should enforce t.