You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to be able to specify specific files that shouldn't count as "usage" for a particular export.
In one of my projects, if the import is used in a particular file, we don't want it to count as it actually being used because it's a common place to import a long list of them to add some meta data/behavior, but it doesn't mean it will actually be used in the application code.
For example, deleting that specific file and re-running Knip would report the export as unused and that is the sort of the behavior we're looking for.
generated.ts
/* Generate file with a bunch of exports */exportFOO1="123";exportFOO2="456";// ...
meta-function.ts
/* Common place to import all of them and register some meta behavior */import{FOO1,FOO2}from'./generated.ts';meta(FOO1,FOO2);
Suggest an idea for this project
It would be great to be able to specify specific files that shouldn't count as "usage" for a particular export.
In one of my projects, if the import is used in a particular file, we don't want it to count as it actually being used because it's a common place to import a long list of them to add some meta data/behavior, but it doesn't mean it will actually be used in the application code.
For example, deleting that specific file and re-running Knip would report the export as unused and that is the sort of the behavior we're looking for.
generated.ts
meta-function.ts
app.ts
We don't want
FOO2
to be counted as used since it's not referenced by App code.The text was updated successfully, but these errors were encountered: