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>
This commit is contained in:
Rich Trott 2018-09-16 20:49:11 -07:00 коммит произвёл Michaël Zasso
Родитель 25220f0ce1
Коммит 6367349a95
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 770F7A9A5AE15600
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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.'