lib/rules/template-curly-spacing.js
function checkSpacingBefore(token) {
            const prevToken = sourceCode.getTokenBefore(token);

            if (prevToken &&
                CLOSE_PAREN.test(token.value) &&
                astUtils.isTokenOnSameLine(prevToken, token) &&
                sourceCode.isSpaceBetweenTokens(prevToken, token) !== always
            ) {
                context.report({
                    loc: token.loc.start,
                    messageId: `${prefix}Before`,
                    fix(fixer) {
                        if (always) {
                            return fixer.insertTextBefore(token, " ");
                        }
                        return fixer.removeRange([
                            prevToken.range[1],
                            token.range[0]
                        ]);
                    }
                });
            }
        }
function checkSpacingBefore(token) {
            const prevToken = sourceCode.getTokenBefore(token);

            if (prevToken &&
                CLOSE_PAREN.test(token.value) &&
                astUtils.isTokenOnSameLine(prevToken, token) &&
                sourceCode.isSpaceBetweenTokens(prevToken, token) !== always
            ) {
                context.report({
                    loc: token.loc.start,
                    messageId: `${prefix}Before`,
                    fix(fixer) {
                        if (always) {
                            return fixer.insertTextBefore(token, " ");
                        }
                        return fixer.removeRange([
                            prevToken.range[1],
                            token.range[0]
                        ]);
                    }
                });
            }
        }
function checkSpacingBefore ( token ) { const prevToken = sourceCode . getTokenBefore ( token ) ; if ( prevToken && CLOSE_PAREN . test ( token . value ) && astUtils . isTokenOnSameLine ( prevToken , token ) && sourceCode . isSpaceBetweenTokens ( prevToken , token ) !== always ) { context . report ( { loc : token . loc . start , messageId : ` ${ prefix } ` , fix ( fixer ) { if ( always ) { return fixer . insertTextBefore ( token , " " ) ; } return fixer . removeRange ( [ prevToken . range [ 1 ] , token . range [ 0 ] ] ) ; } } ) ; } }
Checks spacing before `}` of a given token.
@param {Token} token - A token to check. This is a Template token.
@returns {void}
Checks spacing before } of a given token .