diff options
author | Rich Trott <rtrott@gmail.com> | 2018-09-16 20:49:11 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-09-18 12:34:28 -0700 |
commit | 8d7aa2167f7b87c4143a01be41096aad4c3f0936 (patch) | |
tree | 9dbbf6e83ab3e029633780db3f3d0c2bfaeec28c /.eslintrc.js | |
parent | f28c6f7eef58e7c3133bb2cd457d05b986194ba3 (diff) | |
download | node-new-8d7aa2167f7b87c4143a01be41096aad4c3f0936.tar.gz |
tools: synchronize deepStrictEqual() message rules
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: https://github.com/nodejs/node/pull/22887
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to '.eslintrc.js')
-rw-r--r-- | .eslintrc.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index 99cef88669..8aa090e889 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -160,6 +160,10 @@ module.exports = { '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.' }, |