'Checks that only necessary escape() are used.
Allows for _.escape(), although this shouldn\'t be the recommendation.
Arguments:
file_contents: The contents of the JavaScript file.
results: A file results objects to which violations will be added.'

def _check_javascript_escape(self, file_contents, results):

    regex = regex = re.compile('(?<!_).escape\\(')
    for function_match in regex.finditer(file_contents):
        expression = self._get_expression_for_function(file_contents, function_match)
        results.violations.append(ExpressionRuleViolation(Rules.javascript_escape, expression))
