-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Running in production mode doesn't allow for easy tagging of internal-only files (as opposed to internal exports) #745
Comments
Oh no:
|
my bad, changed sharing settings to public. First time dealing with a devbox via codesandbox 😅 |
I think what you're after is to exclude {
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["index.ts!", "test.ts"],
"project": ["*.ts!", "!test_util.ts!"]
} The general case with e.g. |
we could do that, but I agree with the philosophy in #706 that ideally we wouldn't have a typical workflow that involves users changing arrays in config files. That example ought to demonstrate what I see the issue being. For a file that's got internal and production exports i.e. |
Let's keep only #706 open for discussion. |
Reproduction url
https://codesandbox.io/p/devbox/k23sxr
Description of the issue
In the above repro, you can see that in
other_util.ts
I was able to appease knip by tagging the test-specific export as/** @internal */
. However, if every export (i.e. the entire file) is only used by tests, then there's no recourse I'm aware of (other than theignore
in the config) to allow knip to pass.Ideally we could tag every export of
test_util.ts
with/** @internal */
and the result would be knip not reporting it as unused in production mode.Please let me know if I'm somehow made a mistake in my configuration. I'm still wrapping my head around entry vs. project vs. ignore, and production vs. not.
This is related to #706 and there may be overlap, but my gut said the solution to the two issues would be separate.
The text was updated successfully, but these errors were encountered: