-
-
Notifications
You must be signed in to change notification settings - Fork 459
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(eslint/no_undef): typescript utility types were detected as undefined variables #7195
Conversation
…ined variables fix oxc-project#7007, fix oxc-project#7008
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
); | ||
|
||
const TS_UTILITY_TYPES: [&str; 25] = [ |
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.
While I don't actually know how to implement it, @Boshen mentioned checking for symbol flags in the issue. I assume that would mean not using a hard coded list like this.
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.
hmm yeah this is rough, we would have to keep this list exactly up to date with the globals TS requires.
also, if a user was using a package that declares a global (type or var) this would break
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.
I didn't found the ts types list in the repo. So this a first proposal to raise this question too :)
Yeah this doesn't work, we need to check for symbols flags. |
|
@Boshen How do you recommend me to do that ? |
yeah not sure there's a trivial fix for this. |
Yes indeed! Maybe it is not relevant to fix this bug, knowing that if the file is a ts file, then typescript will catch the error before ESLint. Imo, it is only relevant for JavaScript, isn't it ? |
yeah probably only relevant for JS files. |
First contribution to this repo, and first contribution in Rust ! So, please, help me to improve my skills ;) $
fix #7007, fix #7008