Add no-error-ctor-with-notthrows rule#326
Conversation
changed name of test and added more tests with other requested changes.
dbebb22 to
8e4133a
Compare
|
Since the previous PR, AVA changed its throws assertion. It now accepts an object instead, so it makes more sense to detect that: https://github.com/avajs/ava/blob/main/docs/03-assertions.md#throwsfn-expectation-message |
|
I wonder if it now makes more sense to improve https://github.com/avajs/eslint-plugin-ava/blob/main/docs/rules/assertion-arguments.md than to add a new rule for this? |
IMO, this rule affect all assertion. Using it only for
What do you mean ? Should the rule enforce the use of expectation object or disallow the use of constructor in |
Why is it not optimal?
Enforce expectation object. It no longer makes any sense to disallow a constructor as the user wouldn't use a constructor directly for |
I feel like having a rule applying to all assertion, and sometimes another one is kinda misleading. But it might not be a big deal. You decision in the end. |
Not sure how that is misleading. It would be documented. It's not like the user wouldn't want this either as it catches a bug that will crash at runtime. I think |
Fixes #178.
Continue from previous PR #240 with latest review.
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
t.notThrows()