summaryrefslogtreecommitdiff
path: root/.eslintrc.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-04-25 00:46:40 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2019-04-27 18:22:27 +0200
commit31b3dd28429df7ea7ebc84bdfaf8d9eb9e417b41 (patch)
tree250f2f60d550a2b82ae6b94891df97579d16b0ea /.eslintrc.js
parent38f3526f27c91181ec80ea488c177a49252aeb12 (diff)
downloadandroid-node-v8-31b3dd28429df7ea7ebc84bdfaf8d9eb9e417b41.tar.gz
android-node-v8-31b3dd28429df7ea7ebc84bdfaf8d9eb9e417b41.tar.bz2
android-node-v8-31b3dd28429df7ea7ebc84bdfaf8d9eb9e417b41.zip
tools: prohibit `assert.doesNotReject()` in Node.js core
This makes sure we do not use `assert.doesNotReject()` anywhere in our code base. This is just a simple wrapper that catches the rejection and then rejects it again in case of an error. Thus, it is not useful to do that. The error message for `assert.doesNotThrow()` is also improved. PR-URL: https://github.com/nodejs/node/pull/27402 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to '.eslintrc.js')
-rw-r--r--.eslintrc.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index 9aa90c6366..cfada1f65c 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -184,7 +184,11 @@ module.exports = {
},
{
selector: "CallExpression[callee.property.name='doesNotThrow']",
- message: 'Please replace `assert.doesNotThrow()` and add a comment next to the code instead.',
+ message: 'Do not use `assert.doesNotThrow()`. Write the code without the wrapper and add a comment instead.',
+ },
+ {
+ selector: "CallExpression[callee.property.name='doesNotReject']",
+ message: 'Do not use `assert.doesNotReject()`. Write the code without the wrapper and add a comment instead.',
},
{
selector: "CallExpression[callee.property.name='rejects'][arguments.length<2]",