-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
🐛 False positive in rule noUndeclaredVariables
#243
Comments
The issue is the interaction between biome/crates/biome_js_semantic/src/events.rs Lines 307 to 314 in 106538b
Let start with: When we don't have a Do I understand correctly that |
That is the only context in which I've seen Note that MyType extends (OtherType extends infer T ? infer U : InnerFalse) ? OuterTrue : OuterFalse
// T is usable here ^^^^^^^
// U is usable here ^^^^^^^^^ |
@strager Thank you! Could you please explain how quick-lint-js creates scopes for TS? |
Assuming we are parsing Global variable: Overall type parsing algorithm (relevant bits only) (this should be obvious):
When we see
|
noUndeclaredVariables
Another example of code using type ActionPreferenceNames<Name extends PreferenceName, Actions> = {
[ActionName in keyof Actions]?: Actions[ActionName] extends (value: infer U) => void
? KeysWithValuesOfType<Required<GetPreferenceValue<Name>>, Exclude<U, undefined>>
: never;
};
// The U variable is undeclared biome[lint/correctness/noUndeclaredVariables] |
Environment information
What happened?
Using the hook specified in https://docs.pmnd.rs/zustand/guides/auto-generating-selectors apparently raises a false positive in the rule noUndeclaredVariables: playground
Expected result
I think in this case there should be no warning
Code of Conduct
The text was updated successfully, but these errors were encountered: