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

fix: ensure augmentWorkspace honors tsConfig rootDir #933

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

rmunch
Copy link
Contributor

@rmunch rmunch commented Feb 5, 2025

I think this fixes logic that has a bug due to incorrect parenthesis in a ternary. When a rootDir is specified in tsconfig.json that has a value of something other than "src", the rootDir config is not honored. In my case, I do have a src dir, but it's unrelated to my TypeScript source which is located elsewhere (where my rootDir poins to). Knip ends up forcing the workspace srcDir value to "src" due to this bug combined with the presence of a src directory.

I attempted to add a test, but I'm not so familiar with the codebase and could not seem to exercise the right code paths 😞, but can give it another try if needed.

Copy link

pkg-pr-new bot commented Feb 5, 2025

Open in Stackblitz

npm i https://pkg.pr.new/knip@933

commit: 81c0a85

@webpro webpro merged commit 2afffe0 into webpro-nl:main Feb 5, 2025
23 checks passed
@webpro
Copy link
Member

webpro commented Feb 5, 2025

Thanks @rmunch! Simply by looking at the logic/syntax I'm pretty sure you're right. The parentheses placement made no sense.

@webpro
Copy link
Member

webpro commented Feb 11, 2025

🚀 This pull request is included in v5.44.0. See Release 5.44.0 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants