code: function convert(messages, sourceCode, ruleId, severity, keepAsIs) {
      for (let i = messages.length - 1; i >= 0; --i) {
          const message = messages[i]
          if (!isUnusedDisableDirectiveError(message)) {
              continue
          }
  
          const newMessage = createNoUnusedDisableError(
              ruleId,
              severity,
              message,
              getCommentAt(message, sourceCode)
          )
  
          if (keepAsIs) {
              messages.splice(i + 1, 0, newMessage)
          } else {
              messages.splice(i, 1, newMessage)
          }
      }
  
      return messages
  }
docs: Convert `reportUnusedDisableDirectives` errors to `eslint-comments/no-unused-disable` errors.
  @param {Message[]} messages The original messages.
  @param {SourceCode|undefined} sourceCode The source code object.
  @param {string} ruleId The rule ID to convert.
  @param {number} severity The severity of the rule.
  @param {boolean} keepAsIs The flag to keep original errors as is.
  @returns {Message[]} The converted messages.