function fixByTrimmingWhitespace(fixer, fromLoc, toLoc, mode, spacing) {
      let replacementText = getSourceCode(context).text.slice(fromLoc, toLoc);
      if (mode === 'start') {
        replacementText = replacementText.replace(/^\s+/gm, '');
      } else {
        replacementText = replacementText.replace(/\s+$/gm, '');
      }
      if (spacing === SPACING.always) {
        if (mode === 'start') {
          replacementText += ' ';
        } else {
          replacementText = ` ${replacementText}`;
        }
      }
      return fixer.replaceTextRange([fromLoc, toLoc], replacementText);
    }
Trims text of whitespace between two ranges
@param {Fixer} fixer - the eslint fixer object
@param {number} fromLoc - the start location
@param {number} toLoc - the end location
@param {string} mode - either 'start' or 'end'
@param {string=} spacing - a spacing value that will optionally add a space to the removed text
@returns {Object|*|{range, text}}