tools: .eslintrc.js messages "default" typo style

"Default" typo pattern for .eslintrc.js messages

* all methods and syntax keywords between backticks
* written numbers
* moving /* eslint-disable max-len */
* Error object backtick

PR-URL: https://github.com/nodejs/node/pull/22868
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Lovingly 2018-09-14 20:05:11 -03:00 committed by Anna Henningsen
parent 1b274287c9
commit 4e09fc3359
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -123,27 +123,28 @@ module.exports = {
'no-proto': 'error',
'no-redeclare': 'error',
'no-restricted-modules': ['error', 'sys'],
/* eslint-disable max-len */
'no-restricted-properties': [
'error',
{
object: 'assert',
property: 'deepEqual',
message: 'Use assert.deepStrictEqual().',
message: 'Use `assert.deepStrictEqual()`.',
},
{
object: 'assert',
property: 'notDeepEqual',
message: 'Use assert.notDeepStrictEqual().',
message: 'Use `assert.notDeepStrictEqual()`.',
},
{
object: 'assert',
property: 'equal',
message: 'Use assert.strictEqual() rather than assert.equal().',
message: 'Use `assert.strictEqual()` rather than `assert.equal()`.',
},
{
object: 'assert',
property: 'notEqual',
message: 'Use assert.notStrictEqual() rather than assert.notEqual().',
message: 'Use `assert.notStrictEqual()` rather than `assert.notEqual()`.',
},
{
property: '__defineGetter__',
@ -154,7 +155,6 @@ module.exports = {
message: '__defineSetter__ is deprecated.',
}
],
/* eslint-disable max-len */
// If this list is modified, please copy the change to lib/.eslintrc.yaml
// and test/.eslintrc.yaml.
'no-restricted-syntax': [
@ -169,7 +169,7 @@ module.exports = {
},
{
selector: "CallExpression[callee.object.name='assert'][callee.property.name='rejects'][arguments.length<2]",
message: 'assert.rejects() must be invoked with at least two arguments.',
message: '`assert.rejects()` must be invoked with at least two arguments.',
},
{
selector: "CallExpression[callee.object.name='assert'][callee.property.name='strictEqual'][arguments.2.type='Literal']",
@ -177,23 +177,23 @@ module.exports = {
},
{
selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])",
message: 'Use an object as second argument of assert.throws()',
message: 'Use an object as second argument of `assert.throws()`.',
},
{
selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]",
message: 'assert.throws() must be invoked with at least two arguments.',
message: '`assert.throws()` must be invoked with at least two arguments.',
},
{
selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
message: 'setTimeout() must be invoked with at least two arguments.',
message: '`setTimeout()` must be invoked with at least two arguments.',
},
{
selector: "CallExpression[callee.name='setInterval'][arguments.length<2]",
message: 'setInterval() must be invoked with at least 2 arguments.',
message: '`setInterval()` must be invoked with at least two arguments.',
},
{
selector: 'ThrowStatement > CallExpression[callee.name=/Error$/]',
message: 'Use new keyword when throwing an Error.',
message: 'Use `new` keyword when throwing an `Error`.',
}
],
/* eslint-enable max-len */