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 <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
cjihrig
2019-12-31 10:43:06 -05:00
committed by Rich Trott
parent 9cdda60081
commit b8d2ba67a6

View File

@@ -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)
};
};