Conversation
commit: |
|
A lot of the decisions made here are the same I chose for What I'm not sure from the docs whether one can go and edit it manually (to tackle the next removal for instance) or if that would cause problems for Knip.
Does this only check suppressions are up to date, or does it also run knip? In other words, should people run ExpiryOne feature I'm worried about (that I also considered but ended up rejecting) is the expiry feature. I believe that this can be useful, but it also means that at some point, builds will simply start failing after the expiry date has been reached. Here are two scenarios off the top of my head:
In order to be more helpful, I'm guessing some kind of message saying "Warning: Some suppressed errors will be reported in 5 days!" could be useful in order to not be a total surprise. But:
I believe these are pain points that make the feature potentially more painful than helpful, hence why I decided against it. If you decide to keep this feature: I don't know if you indicate why something was unsuppressed, but it's probably good to indicate in this case that the given date was reached. Great work for the rest, this is a really nice feature! ❤️ |
|
Thanks a lot, those are all great points. Let me address a few right away:
I'm going to let it sink in for a bit more and update docs and perhaps implementation as well accordingly. Thanks! |
23f8020 to
b6afc01
Compare
|
One concern I have with this is that it requires all of the suppressions to be done in the same file, which can be painful for merging. Being able to do exactly this but in JSDoc form (or similar) would then mean that merges are much cleaner and the suppressions are kept with the context of what's being suppressed. |
|
That's what the non-standard arbitrary tags are for: https://knip.dev/reference/jsdoc-tsdoc-tags#tags (as mentioned here: https://feat-bulk-suppressions.knip.pages.dev/features/bulk-suppressions#suppressions-vs-jsdoc-tags). |
But these don't support Knip warning / erroring if they're no longer necessary, do they? If they do then that's exactly what I'm looking for :) Cheers |
They do! Was poorly documented, just extended https://knip.dev/reference/jsdoc-tsdoc-tags#tags |
This pull request introduces a bulk suppressions system in Knip.
The
ignore*configuration options are a means to get rid of false positives (i.e. when Knip is wrong), not for actual issues you want to deal with later. Suppressions aims to fix this.For instance, Knip doesn't read unused files at all, so they can't be suppressed other than using
ignoreFiles(orignore) patterns — even though they might not be false positives.Large projects with lots of issues should benefit significantly from a more iterative and managed flow to deal with issues as reported by Knip. For instance, teams can tackle issues by issue type and monorepo workspaces (e.g. there's commands for "today we're going to fix unused exports in a particular workspace").
Please head over to https://feat-bulk-suppressions.knip.pages.dev/features/bulk-suppressions for initial documentation including examples and possible workflows.
This pull request has been opened to discuss feedback. Feel free to express ideas, questions, concerns, etc.