diff --git a/.eslintrc b/.eslintrc index 6e483a13b7..262717980f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -63,6 +63,12 @@ rules: object: assert, property: deepEqual, message: Please use assert.deepStrictEqual(). + }, { + property: __defineGetter__, + message: __defineGetter__ is deprecated. + }, { + property: __defineSetter__, + message: __defineSetter__ is deprecated. }] # Stylistic Issues @@ -112,7 +118,6 @@ rules: align-multiline-assignment: 2 assert-fail-single-argument: 2 new-with-error: [2, Error, RangeError, TypeError, SyntaxError, ReferenceError] - no-definegetter-definesetter: 2 # Global scoped method and vars globals: diff --git a/tools/eslint-rules/no-definegetter-definesetter.js b/tools/eslint-rules/no-definegetter-definesetter.js deleted file mode 100644 index 3de010f47f..0000000000 --- a/tools/eslint-rules/no-definegetter-definesetter.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @fileoverview Rule to flag usage of __defineGetter__ and __defineSetter__ - * @author Rich Trott - */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = { - create: function(context) { - const disallowed = ['__defineGetter__', '__defineSetter__']; - - return { - MemberExpression: function(node) { - var prop; - if (node.property) { - if (node.property.type === 'Identifier' && !node.computed) { - prop = node.property.name; - } else if (node.property.type === 'Literal') { - prop = node.property.value; - } - if (disallowed.includes(prop)) { - context.report(node, `The ${prop} property is deprecated.`); - } - } - } - }; - } -};