anchor.diff:  
   ''';
   
  -bool _isFunctionExpression(AstNode node) => node is FunctionExpression;
  -
   bool _returnsThis(ReturnStatement node) => node.expression is ThisExpression;
   
   class AvoidReturningThis extends LintRule {
  
positive.code: 
      var body = node.body;
      if (body is BlockFunctionBody) {
        var returnStatements = body.block
            .traverseNodesInDFS(excludeCriteria: _isFunctionExpression)
            .whereType<ReturnStatement>();
        if (returnStatements.isNotEmpty && returnStatements.every(_returnsThis)) {
          rule.reportLint(returnStatements.first.expression);
        }
      } else if (body is ExpressionFunctionBody) {
  
negative.code:       NodeLintRegistry registry, LinterContext context) {
      var visitor = _Visitor(this);
      registry.addMethodDeclaration(this, visitor);
    }
  }
  
  class _BodyVisitor extends RecursiveAstVisitor {
    List<ReturnStatement> returnStatements = [];
  
    List<ReturnStatement> collectReturns(BlockFunctionBody body) {
      body.accept(this);
      return returnStatements;
    }
  
    @override
    visitFunctionExpression(FunctionExpression node) {
      // Short-circuit visiting on Function expressions.
    }
  
    @override
    visitReturnStatement(ReturnStatement node) {
      // Short-circuit if not returning this.
      if (!_returnsThis(node)) return;
  
      returnStatements.add(node);
      super.visitReturnStatement(node);
    }
  }
  
  