Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 Report missing entries (file defined in entry but missing) #941

Closed
fregante opened this issue Feb 10, 2025 · 1 comment
Closed

💡 Report missing entries (file defined in entry but missing) #941

fregante opened this issue Feb 10, 2025 · 1 comment
Labels
feature request Feature request

Comments

@fregante
Copy link

fregante commented Feb 10, 2025

Repro

Config:

{
    "$schema": "https://unpkg.com/knip@5/schema.json",
    "entry": [
        "b.js"
    ]
}

Repo contents:

  • a.js

Command:

$ npx knip@5.43.6

Current output

$ npx knip@5.43.6
Unused files (1)
a.js

This is a config error on my part, but knip did not alert me.

Ideal output

$ npx knip@5.43.6

Unused files (1)
a.js

Entries not found (1)
b.js

Ideal output part 2

Globs could also be reported if they don't match anything, both as entry and project.

{
    "$schema": "https://unpkg.com/knip@5/schema.json",
    "entry": [
        "*.ts"
    ]
}
$ npx knip@5.43.6

Unused files (1)
a.js

Glob not matching any files (1)
*.ts
@fregante fregante added the feature request Feature request label Feb 10, 2025
@webpro
Copy link
Member

webpro commented Feb 10, 2025

Thanks for the idea, but Knip optimizes a bit by merging together multiple glob patterns, making this RFC more expensive and complex than I'm willing to add currently.

@webpro webpro closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants