From c23bbc6fe2317e0c359d6c62b3e44cd50b07c11a Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 31 Dec 2019 10:43:06 -0500 Subject: [PATCH] tools: remove prefer-common-expectserror lint rule This custom ESLint rule is unused since https://github.com/nodejs/node/pull/31092. This commit removes it. PR-URL: https://github.com/nodejs/node/pull/31147 Reviewed-By: Ruben Bridgewater Reviewed-By: David Carlier Reviewed-By: Anto Aravinth Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: Jiawen Geng Reviewed-By: Daijiro Wachi Reviewed-By: James M Snell --- .../prefer-common-expectserror.js | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 tools/eslint-rules/prefer-common-expectserror.js diff --git a/tools/eslint-rules/prefer-common-expectserror.js b/tools/eslint-rules/prefer-common-expectserror.js deleted file mode 100644 index f33241697a68ef..00000000000000 --- a/tools/eslint-rules/prefer-common-expectserror.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -const msg = 'Please use common.expectsError(fn, err) instead of ' + - 'assert.throws(fn, common.expectsError(err)).'; - -const astSelector = - 'CallExpression[arguments.length=2]' + - '[callee.object.name="assert"]' + - '[callee.property.name="throws"]' + - '[arguments.1.callee.object.name="common"]' + - '[arguments.1.callee.property.name="expectsError"]'; - -module.exports = function(context) { - return { - [astSelector]: (node) => context.report(node, msg) - }; -};