Skip to content

Commit 6165d15

Browse files
committed
Update: support old-style context.report calls.
1 parent a596dc4 commit 6165d15

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/rules/fixer-return.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,11 @@ module.exports = {
6565
onCodePathStart (codePath, node) {
6666
const parent = node.parent;
6767
const shouldCheck = node.type === 'FunctionExpression' &&
68-
node.body.type === 'BlockStatement' &&
69-
// check if it is context.report({fix})
70-
utils.getKeyName(parent) === 'fix' &&
7168
parent.parent.type === 'ObjectExpression' &&
7269
parent.parent.parent.type === 'CallExpression' &&
7370
contextIdentifiers.has(parent.parent.parent.callee.object) &&
74-
parent.parent.parent.callee.property.name === 'report';
71+
parent.parent.parent.callee.property.name === 'report' &&
72+
utils.getReportInfo(parent.parent.parent.arguments).fix === node;
7573

7674
funcInfo = {
7775
upper: funcInfo,

0 commit comments

Comments
 (0)