Skip to content

🐛 Default/compact reporters omit issue-type title and count when only one type is reported #1793

Description

@WooWan

Prerequisites

Reproduction url

https://github.com/WooWan/knip-reporter-reproduction

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

When only one issue type is reported (e.g. knip --include=dependencies or --strict), the symbols (default) and compact reporters drop the type title and count (e.g. Unused dependencies (2)). With multiple types they're shown.

$ knip
Unused dependencies (2)        # title + count shown
chokidar  package.json:15:6
execa     package.json:16:6

$ knip --include=dependencies --strict
chokidar  package.json:15:6    # title + count missing
execa     package.json:16:6

This is gated on reportMultipleGroups (symbols.ts:8, compact.ts:11), so it may be intentional. Even so, always showing the title and count would be convenient: the count is useful at a glance (CI logs, PR comments), and output stays consistent so --include/--strict doesn't silently change the report's shape.

Proposal

Always render the type title and count, or add an option to opt into it for single-type runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions