Skip to content

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Aug 2, 2024

Blocked on:

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 2, 2024
@jakebailey
Copy link
Member Author

@webpro Do you happen to know why knip would be complaining about @typescript-eslint/rule-tester being unused, even though debug logs seem to imply that scripts/eslint/tests/support/RuleTester.cjs is analyzed?

@webpro
Copy link
Contributor

webpro commented Aug 5, 2024

@webpro Do you happen to know why knip would be complaining about @typescript-eslint/rule-tester being unused, even though debug logs seem to imply that scripts/eslint/tests/support/RuleTester.cjs is analyzed?

Not entirely sure, but some relevant bits include:

  • Knip does not automatically split projects based on tsconfig.json files. This repo is a single workspace to Knip and all files are in a single ts.Program with a single custom module resolver function.
  • No root tsconfig.json means no value for compilerOptions.moduleResolution when ts.resolveModuleName() is invoked. That could explain why @typescript-eslint/utils was resolved (by @import in JSDoc tag) but not @typescript-eslint/rule-tester (by require call).
  • In that custom function Knip uses an additional module resolver (prior to ts.resolveModuleName). Coincidentally last week the resolve package that this is based on has been replaced with enhanced-resolve and that seems to do the trick here. Not exactly sure why, though. I expect this fix to be released this week.

@jakebailey
Copy link
Member Author

Updated knip and yeah, that works, thanks!

@jakebailey jakebailey marked this pull request as ready for review August 8, 2024 18:41
@jakebailey jakebailey merged commit 01a874a into microsoft:main Aug 13, 2024
@jakebailey jakebailey deleted the eslint-9 branch August 13, 2024 00:13
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants