Skip to content

Commit 6367349

Browse files
Trotttargos
authored andcommitted
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: #22887 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 25220f0 commit 6367349

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ module.exports = {
159159
// and test/.eslintrc.yaml.
160160
'no-restricted-syntax': [
161161
'error',
162+
{
163+
selector: "CallExpression[callee.object.name='assert'][callee.property.name='deepStrictEqual'][arguments.2.type='Literal']",
164+
message: 'Do not use a literal for the third argument of assert.deepStrictEqual()'
165+
},
162166
{
163167
selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']",
164168
message: 'Please replace `assert.doesNotThrow()` and add a comment next to the code instead.'

0 commit comments

Comments
 (0)