function reportDifference(context, difference) {
  const { operation, offset, deleteText = '', insertText = '' } = difference;
  /** @type {AST.Range} */
  const range = [offset, offset + deleteText.length];
  // `context.getSourceCode()` was deprecated in ESLint v8.40.0 and replaced
  // with the `sourceCode` property.
  // TODO: Only use property when our eslint peerDependency is >=8.40.0.
  const [start, end] = range.map(index =>
    (context.sourceCode ?? context.getSourceCode()).getLocFromIndex(index),
  );

  context.report({
    messageId: operation,
    data: {
      deleteText: showInvisibles(deleteText),
      insertText: showInvisibles(insertText),
    },
    loc: { start, end },
    fix: fixer => fixer.replaceTextRange(range, insertText),
  });
}
Reports a difference.

@param {Rule.RuleContext} context - The ESLint rule context.
@param {Difference} difference - The difference object.
@returns {void}