def METHOD_NAME(
    issues: List[LinterIssue], *, json_output: bool = False, intermediate: bool = False
) -> LinterStatus:
    """Display the linter report in textual or json formats.
    :param issues: The list of issues to display.
    :param json_output: Display issues in json format.
    :param intermediate: Set if the linter output are is not the main
        outcome of the command execution.
    """
    if intermediate:
        display = partial(emit.progress, permanent=True)
    else:
        display = emit.message
    status = LinterStatus.OK
    # split dictionary based on result
    issues_by_result: Dict[LinterResult, List[LinterIssue]] = {}
    for issue in issues:
        status = _update_status(status, issue.result)
        if status == LinterStatus.FATAL:
            break
        if issue.result in _lint_reports:
            issues_by_result.setdefault(issue.result, []).append(issue)
    if json_output:
        display(json.dumps([x.dict(exclude_none=True) for x in issues]))
    else:
        # show issues by result
        for result, header in _lint_reports.items():
            if issues_by_result.get(result):
                display(f"{header}:")
                for issue in issues_by_result[result]:
                    display(f"- {issue!s}")
    return status