function reportUnusedRules(context, comment, kind, rules) {
  const sourceCode = context.getSourceCode()
  const commentStart = comment.range[0] + 4 /* <!-- */

  return rules.map((rule) => {
    const start = sourceCode.getLocFromIndex(commentStart + rule.index)
    const end = sourceCode.getLocFromIndex(
      commentStart + rule.index + rule.ruleId.length
    )

    context.report({
      loc: { start, end },
      messageId: 'unusedRule',
      data: { rule: rule.ruleId, kind }
    })

    return {
      ruleId: rule.ruleId,
      key: locToKey(start)
    }
  })
}
Reports unused disable directive rules.
Do not check the use of directives here. Filter the directives used with postprocess.
@param {RuleContext} context The rule context.
@param {Token} comment The comment token to report.
@param {string} kind The comment directive kind.
@param {RuleAndLocation[]} rules To report rule.
@returns { { ruleId: string, key: string }[] }