diff --git a/lib/rules/prefer-arrow-callback.js b/lib/rules/prefer-arrow-callback.js index 4e4d129..2d2793c 100644 --- a/lib/rules/prefer-arrow-callback.js +++ b/lib/rules/prefer-arrow-callback.js @@ -187,9 +187,8 @@ module.exports = { const sourceCode = context.getSourceCode(); /* - * {Array<{this: boolean, super: boolean, meta: boolean}>} + * {Array<{this: boolean, meta: boolean}>} * - this - A flag which shows there are one or more ThisExpression. - * - super - A flag which shows there are one or more Super. * - meta - A flag which shows there are one or more MetaProperty. */ let stack = []; @@ -199,12 +198,12 @@ module.exports = { * @returns {void} */ function enterScope() { - stack.push({ this: false, super: false, meta: false }); + stack.push({ this: false, meta: false }); } /** * Pops a function scope from the stack. - * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope. + * @returns {{this: boolean, meta: boolean}} The information of the last scope. */ function exitScope() { return stack.pop(); @@ -226,14 +225,6 @@ module.exports = { } }, - Super() { - const info = stack[stack.length - 1]; - - if (info) { - info.super = true; - } - }, - MetaProperty() { const info = stack[stack.length - 1]; @@ -278,7 +269,6 @@ module.exports = { if (callbackInfo.isCallback && (!allowUnboundThis || !scopeInfo.this || callbackInfo.isLexicalThis) && - !scopeInfo.super && !scopeInfo.meta && !callbackInfo.isMochaCallback ) { diff --git a/test/rules/prefer-arrow-callback.js b/test/rules/prefer-arrow-callback.js index bdd5351..4264d91 100644 --- a/test/rules/prefer-arrow-callback.js +++ b/test/rules/prefer-arrow-callback.js @@ -40,9 +40,6 @@ ruleTester.run('prefer-arrow-callback', rules['prefer-arrow-callback'], { 'foo(function bar() { bar; });', 'foo(function bar() { arguments; });', 'foo(function bar() { arguments; }.bind(this));', - 'foo(function bar() { super.a; });', - 'foo(function bar() { super.a; }.bind(this));', - '() => super()', 'foo(function bar() { new.target; });', 'foo(function bar() { new.target; }.bind(this));', 'foo(function bar() { this; }.bind(this, somethingElse));',