From 7af4e8e7089dc549aae65f84b7f55089b91e04f3 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 16 Sep 2018 20:49:11 -0700 Subject: [PATCH] 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. --- .eslintrc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index e4192c3539925c..8347d066ed22ec 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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.'