lib/rules/key-spacing.js
function getKeyWidth(property) {
            const startToken = sourceCode.getFirstToken(property);
            const endToken = getLastTokenBeforeColon(property.key);

            return endToken.range[1] - startToken.range[0];
        }
function getKeyWidth(property) {
            const startToken = sourceCode.getFirstToken(property);
            const endToken = getLastTokenBeforeColon(property.key);

            return endToken.range[1] - startToken.range[0];
        }
function getKeyWidth ( property ) { const startToken = sourceCode . getFirstToken ( property ) ; const endToken = getLastTokenBeforeColon ( property . key ) ; return endToken . range [ 1 ] - startToken . range [ 0 ] ; }
Gets the number of characters in a key, including quotes around string
keys and braces around computed property keys.
@param {ASTNode} property Property of on object literal.
@returns {int} Width of the key.
Gets the number of characters in a key including quotes around string keys and braces around computed property keys .