mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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)
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user