js/eslint.js
/**
     * Validates the spacing before function parentheses.
     * @param {ASTNode} node The node to be validated.
     * @returns {void}
     */
Validates the spacing before function parentheses.
@param {ASTNode} node The node to be validated.
@returns {void}
Validates the spacing before function parentheses . @param { ASTNode } node The node to be validated . @returns { void }
function validateSpacingBeforeParentheses(node) {
        var tokens = context.getTokens(node),
            isNamedFunction = node.id ? true : false,
            leftToken,
            rightToken,
            location;
        if (isNamedFunction) {
            leftToken = tokens[1];
            rightToken = tokens[2];
        } else {
            leftToken = tokens[0];
            rightToken = tokens[1];
        }
        location = leftToken.loc.end;
        if (isSpaced(leftToken, rightToken)) {
            if ((isNamedFunction && !requireNamedFunctionSpacing) || (!isNamedFunction && !requireAnonymousFunctionSpacing)) {
                context.report(node, location, "Unexpected space before function parentheses.");
            }
        } else {
            if ((isNamedFunction && requireNamedFunctionSpacing) || (!isNamedFunction && requireAnonymousFunctionSpacing)) {
                context.report(node, location, "Missing space before function parentheses.");
            }
        }
    }
function validateSpacingBeforeParentheses ( node ) { var tokens = context . getTokens ( node ) , isNamedFunction = node . id ? true : false , leftToken , rightToken , location ; if ( isNamedFunction ) { leftToken = tokens [ 1 ] ; rightToken = tokens [ 2 ] ; } else { leftToken = tokens [ 0 ] ; rightToken = tokens [ 1 ] ; } location = leftToken . loc . end ; if ( isSpaced ( leftToken , rightToken ) ) { if ( ( isNamedFunction && ! requireNamedFunctionSpacing ) || ( ! isNamedFunction && ! requireAnonymousFunctionSpacing ) ) { context . report ( node , location , "Unexpected space before function parentheses." ) ; } } else { if ( ( isNamedFunction && requireNamedFunctionSpacing ) || ( ! isNamedFunction && requireAnonymousFunctionSpacing ) ) { context . report ( node , location , "Missing space before function parentheses." ) ; } } }
Validates the spacing before function parentheses.
Validates the spacing before function parentheses .