Skip to content

Commit

Permalink
tools: .eslintrc.js messages "default" typo style
Browse files Browse the repository at this point in the history
"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: #22868
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
lovinglyy authored and targos committed Sep 25, 2018
1 parent 24073ce commit f6fc7e7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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__',
Expand All @@ -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': [
Expand All @@ -169,31 +169,31 @@ 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']",
message: 'Do not use a literal for the third argument of assert.strictEqual()'
},
{
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 */
Expand Down

0 comments on commit f6fc7e7

Please sign in to comment.