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:
Родитель
25220f0ce1
Коммит
6367349a95
|
@ -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.'
|
||||
|
|
Загрузка…
Ссылка в новой задаче