-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: add knip #8192
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
chore: add knip #8192
Conversation
Thanks for the PR, @auvred! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -1,5 +1,9 @@ | |||
'use strict'; | |||
|
|||
// @ts-check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Praise] Nice, +1 to getting // @ts-check
in here.
This reverts commit 36fa481.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✂️ this is fantastic, nice job @auvred! Love the explanations throughout and all the removed stuff.
Nothing I commented is a blocker IMO. They can all be followup issues IMO.
knip.ts
Outdated
'packages/repo-tools': { | ||
ignoreDependencies: ['tsconfig.json'], | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this feels like a feature request for Knip: shouldn't it understand that npx tsc
goes to TypeScript?
...separately, -p
defaults to tsconfig.json
. yarn knip
and yarn typecheck
pass happily for me when I remove the -p tsconfig.json
altogether. Maybe a good reason to remove them?
'src/mock/lru-cache.js', | ||
'src/mock/path.js', | ||
'src/mock/typescript.js', | ||
'src/mock/util.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know, as a followup I bet we could switch these over to plain .ts
files, and remove the need for the requireResolved
that's tripping up Knip... Not blocking at all IMO.
@@ -1,4 +1,5 @@ | |||
export * from './applyDefault'; | |||
export * from './context'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably yeah. The fact that nobody has reported anything makes me less motivated to - but, yeah, we should.
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
@@ -13,16 +13,21 @@ | |||
"lint": "npx nx lint", | |||
"postinstall-script": "npx tsx ./src/postinstall.mts", | |||
"test": "npx jest --coverage", | |||
"typecheck": "npx tsc -p tsconfig.json --noEmit" | |||
"typecheck": "npx tsc --noEmit" |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Hey folks, this is great! I didn't check out the details of this PR, but feel free to drag me into this, love to help out a bit here. If there's feature requests or other annoying stuff in/from Knip I'd love to hear about it. |
UPD: this issue has been resolved on |
Unfortunately, merging Every Monday, after the automatic release, there are a few merge conflicts due to bumped |
@auvred Could you try running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forwarding #8192 (comment) here:
@rubiesonthesky, I've already ran yarn dedupe
in one of the previous commits on this PR, but the ast-spec
tests didn't pass with deduped lockfile:
https://github.com/typescript-eslint/typescript-eslint/actions/runs/8804176361/job/24164146899
So, I reverted these changes in 5c56b50
Might be useful info: Joshua ran yarn dedupe
in the #9002 (merged in v8
branch) - #9002 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@auvred Sorry and thank you :) That explains everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP! Thank you for Renovate issue investigation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think once someone takes the time to fix the test errors in #8589, we could probably keep it deduped forever. Which would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 looks fantastic, thanks for pressing on this! Very excited to have the cross-file unused code detection.
Marking as 1 approval
to give you a chance to merge whenever you want. 😁
PR Checklist
Overview
TODO:
working-directory
keyword in GitHub Actions workflows webpro-nl/knip#433