function isNextLineEmpty(text, startIndex) {
  /** @type {number | false} */
  let oldIdx = null;
  /** @type {number | false} */
  let idx = startIndex;
  while (idx !== oldIdx) {
    // We need to skip all the potential trailing inline comments
    oldIdx = idx;
    idx = skipToLineEnd(text, idx);
    idx = skipInlineComment(text, idx);
    idx = skipSpaces(text, idx);
  }
  idx = skipTrailingComment(text, idx);
  idx = skipNewline(text, idx);
  return idx !== false && hasNewline(text, idx);
}
@param {string} text
@param {number} startIndex
@returns {boolean}