code: function checkSpaces({
    string,
    globalIndex,
    startIndex,
    endIndex,
    node,
    result
  }) {
    const symbol = string.substring(startIndex, endIndex + 1);
  
    const beforeOk =
      (string[startIndex - 1] === " " && !isWhitespace(string[startIndex - 2])) ||
      newlineBefore(string, startIndex - 1);
  
    if (!beforeOk) {
      utils.report({
        ruleName,
        result,
        node,
        message: messages.expectedBefore(symbol),
        index: startIndex + globalIndex
      });
    }
  
    const afterOk =
      (string[endIndex + 1] === " " && !isWhitespace(string[endIndex + 2])) ||
      string[endIndex + 1] === "\n" ||
      string.substr(endIndex + 1, 2) === "\r\n";
  
    if (!afterOk) {
      utils.report({
        ruleName,
        result,
        node,
        message: messages.expectedAfter(symbol),
        index: endIndex + globalIndex
      });
    }
  }
docs: The actual check for are there (un)necessary whitespaces