-
-
Notifications
You must be signed in to change notification settings - Fork 614
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: update typescript-eslint #2698
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Size Change: 0 B Total Size: 88.1 kB ℹ️ View Unchanged
|
Preview in LiveCodesLatest commit: defca99
See documentations for usage instructions. |
tests/vanilla/utils/types.test.tsx
Outdated
@@ -1,3 +1,5 @@ | |||
/* eslint @typescript-eslint/no-unused-vars: off */ |
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.
@JoshuaKGoldberg is there an option to mark typeof foo
as used?
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.
Not at the moment, no. But I think this is an interesting use case that might be enough to warrant one?
We'd talked about it before in:
- Bug: In v8, no-unused-vars says "defined but only used as type" on import with no escape hatch typescript-eslint/typescript-eslint#9679
- Enhancement: no-unused-vars Prevent "defined but only used as type" error typescript-eslint/typescript-eslint#9697
...but neither is exactly what's happening here.
For this specific file, I think the user need here is that you...
- Need to have the typings tests code wrapped in functions so that they doesn't actually run
- Are using
function Component
s for that, which are getting flagged as unused
...is that right?
If so: I'd suggest naming them something like function _test
per the varsIgnorePattern
. That way you can keep no-unused-vars
enabled & have it just not care about the functions.
Example benefit: types.test.tsx
has an unused import (expect
) right now that would be caught by the rule. 🧹
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.
Hm, that's unfortunate.
I was talking about typeof foo
, not about function test
, which I already resolved.
Thanks for all of your help. I will go with overrides for tests.
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.
Oh! Sorry, I misread. But great!
close #2699