diff options
author | Rich Trott <rtrott@gmail.com> | 2017-07-30 13:46:34 -0700 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-08-07 15:17:26 +0200 |
commit | 9f319d5dfbd651094c43cbeed25af4c782f2468d (patch) | |
tree | 2d837e6bca23aa8c8c294d8666a2c51af30e3f84 /.eslintrc.yaml | |
parent | 5094f2c2994efccfbf39bf8a985c77ec9a41bb4d (diff) | |
download | node-new-9f319d5dfbd651094c43cbeed25af4c782f2468d.tar.gz |
tools: replace assert-throw-arguments custom lint
The functionality of ESLint custom rule assert-throws-arguments can be
replaced with no-restricted-syntax entries.
PR-URL: https://github.com/nodejs/node/pull/14547
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to '.eslintrc.yaml')
-rw-r--r-- | .eslintrc.yaml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/.eslintrc.yaml b/.eslintrc.yaml index dfe99dcca2..3bded1a7ce 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -119,6 +119,12 @@ rules: no-mixed-spaces-and-tabs: error no-multiple-empty-lines: [error, {max: 2, maxEOF: 0, maxBOF: 0}] no-restricted-syntax: [error, { + selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])", + message: "use a regular expression for 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." + }, { selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]", message: "setTimeout() must be invoked with at least two arguments." }, { @@ -162,7 +168,6 @@ rules: template-curly-spacing: error # Custom rules in tools/eslint-rules - assert-throws-arguments: [error, { requireTwo: true }] no-unescaped-regexp-dot: error # Global scoped method and vars |