I've put together a quick/rough list of what argument data type checks we could add to each qunit assertion. Feel free to comment with additional suggestions/corrections.
I do think we should have just a single rule to check the argument data types of all assertions, similar to how we have a single rule assert-args to verify the correct number of arguments for all assertions.
We would use getStaticValue to statically determine the type of arguments where possible. Types that can't be determined would be ignored.
deepEqual / notDeepEqual
equal / notEqual / strictEqual / notStrictEqual
suggest deepEqual and propEqual for objects
suggest deepEqual for arrays
- nothing yet
false / true
- disallow non-boolean values -
assert.true(123);
ok / notOk
propEqual / notPropEqual
- autofix/suggest
strictEqual for literal values - assert.propEqual(foo, 123); - partially covered by qunit/require-object-in-propequal, this existing rule could be deprecated and replaced by the holistic rule
I've put together a quick/rough list of what argument data type checks we could add to each qunit assertion. Feel free to comment with additional suggestions/corrections.
I do think we should have just a single rule to check the argument data types of all assertions, similar to how we have a single rule assert-args to verify the correct number of arguments for all assertions.
We would use getStaticValue to statically determine the type of arguments where possible. Types that can't be determined would be ignored.
deepEqual/notDeepEqualstrictEqualfor literal values -assert.deepEqual(foo, 123);- ava/no-incorrect-deep-equalequal/notEqual/strictEqual/notStrictEqualsuggestdeepEqualandpropEqualfor objectssuggestdeepEqualfor arraysfalse/trueassert.true(123);ok/notOkpropEqual/notPropEqualstrictEqualfor literal values -assert.propEqual(foo, 123);- partially covered by qunit/require-object-in-propequal, this existing rule could be deprecated and replaced by the holistic rule