Skip to content

Commit

Permalink
tools: do not disable quotes rule in .eslintrc.js
Browse files Browse the repository at this point in the history
Re-enable `quotes` rule in .eslintrc.js and fix code to abide by the
rule. As a bonus, this makes the code (IMO, anyway) more readable. (It
certainly isn't *less* readable, at least not IMO.)

PR-URL: #21338
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
Trott committed Jun 18, 2018
1 parent b6b019f commit a13eba7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,32 +147,32 @@ module.exports = {
message: '__defineSetter__ is deprecated.',
}
],
/* eslint-disable max-len, quotes */
/* eslint-disable max-len */
// If this list is modified, please copy the change to lib/.eslintrc.yaml
'no-restricted-syntax': [
'error',
{
selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']",
message: "Please replace `assert.doesNotThrow()` and add a comment next to the code instead."
message: 'Please replace `assert.doesNotThrow()` and add a comment next to the code instead.'
},
{
selector: `CallExpression[callee.object.name='assert'][callee.property.name='rejects'][arguments.length<2]`,
selector: "CallExpression[callee.object.name='assert'][callee.property.name='rejects'][arguments.length<2]",
message: 'assert.rejects() must be invoked with at least two arguments.',
},
{
selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])`,
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()',
},
{
selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]`,
selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]",
message: 'assert.throws() must be invoked with at least two arguments.',
},
{
selector: `CallExpression[callee.name='setTimeout'][arguments.length<2]`,
selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
message: 'setTimeout() must be invoked with at least two arguments.',
},
{
selector: `CallExpression[callee.name='setInterval'][arguments.length<2]`,
selector: "CallExpression[callee.name='setInterval'][arguments.length<2]",
message: 'setInterval() must be invoked with at least 2 arguments.',
},
{
Expand Down

0 comments on commit a13eba7

Please sign in to comment.