Skip to content

Commit

Permalink
tools: synchronize deepStrictEqual() message rules
Browse files Browse the repository at this point in the history
Update ESLint config to include a rule about assert.deepStrictEqual()
messages and string literals. The rule is included in lib and test, but
should be included everywhere else as well.

PR-URL: #22887
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
Trott authored and targos committed Sep 20, 2018
1 parent 25220f0 commit 6367349
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ module.exports = {
// and test/.eslintrc.yaml.
'no-restricted-syntax': [
'error',
{
selector: "CallExpression[callee.object.name='assert'][callee.property.name='deepStrictEqual'][arguments.2.type='Literal']",
message: 'Do not use a literal for the third argument of assert.deepStrictEqual()'
},
{
selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']",
message: 'Please replace `assert.doesNotThrow()` and add a comment next to the code instead.'
Expand Down

0 comments on commit 6367349

Please sign in to comment.