Skip to content

💡 Configuration option to fail on unused items (--treat-config-hints-as-errors) #1026

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Suggest an idea for Knip

I've noticed that sometimes a project that auto-updates Knip with Dependabot/Renovate will start warning on unused items in configs.

$ npx knip
Configuration hints
Unused item in ignoreDependencies: used-to-need-to-be-ignored-but-is-no-longer
✂️  Excellent, Knip found no issues.

But, because they're just warnings and not exit code errors, they don't fail CI. That means the PR updating Knip will get merged and these warnings will start showing up on all knip runs. I like the staying up-to-date but would really prefer to not train developers to ignore warnings in lint commands.

Proposal: could we have an option to fail on any detected unused items?

Prior art/discussion:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions