lib/utils/indent-common.js
function getCommentExpectedIndents (nextToken, nextExpectedIndent, lastExpectedIndent) {
    if (typeof lastExpectedIndent === 'number' && isClosingToken(nextToken)) {
      if (nextExpectedIndent === lastExpectedIndent) {
        // For solo comment. E.g.,
        // <div>
        //    <!-- comment -->
        // </div>
        return {
          primary: nextExpectedIndent + options.indentSize,
          secondary: undefined
        }
      }

      // For last comment. E.g.,
      // <div>
      //    <div></div>
      //    <!-- comment -->
      // </div>
      return { primary: lastExpectedIndent, secondary: nextExpectedIndent }
    }

    // Adjust to next normally. E.g.,
    // <div>
    //    <!-- comment -->
    //    <div></div>
    // </div>
    return { primary: nextExpectedIndent, secondary: undefined }
  }
function getCommentExpectedIndents (nextToken, nextExpectedIndent, lastExpectedIndent) {
    if (typeof lastExpectedIndent === 'number' && isClosingToken(nextToken)) {
      if (nextExpectedIndent === lastExpectedIndent) {
        // For solo comment. E.g.,
        // <div>
        //    <!-- comment -->
        // </div>
        return {
          primary: nextExpectedIndent + options.indentSize,
          secondary: undefined
        }
      }

      // For last comment. E.g.,
      // <div>
      //    <div></div>
      //    <!-- comment -->
      // </div>
      return { primary: lastExpectedIndent, secondary: nextExpectedIndent }
    }

    // Adjust to next normally. E.g.,
    // <div>
    //    <!-- comment -->
    //    <div></div>
    // </div>
    return { primary: nextExpectedIndent, secondary: undefined }
  }
function getCommentExpectedIndents ( nextToken , nextExpectedIndent , lastExpectedIndent ) { if ( typeof lastExpectedIndent === 'number' && isClosingToken ( nextToken ) ) { if ( nextExpectedIndent === lastExpectedIndent ) { // For solo comment. E.g., // <div> //    <!-- comment --> // </div> return { primary : nextExpectedIndent + options . indentSize , secondary : undefined } } // For last comment. E.g., // <div> //    <div></div> //    <!-- comment --> // </div> return { primary : lastExpectedIndent , secondary : nextExpectedIndent } } // Adjust to next normally. E.g., // <div> //    <!-- comment --> //    <div></div> // </div> return { primary : nextExpectedIndent , secondary : undefined } }
Get the expected indent of comments.
@param {Token|null} nextToken The next token of comments.
@param {number|undefined} nextExpectedIndent The expected indent of the next token.
@param {number|undefined} lastExpectedIndent The expected indent of the last token.
@returns {{primary:number|undefined,secondary:number|undefined}}
Get the expected indent of comments .