-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Rule Propsal: No generic type variable shadowing #521
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
Comments
ideally this would be patched into the base rule https://eslint.org/docs/rules/no-shadow instead of creating a brand new rule for this case. |
TypeScript has two namespace; variables and types. The same name can exist each other, and it's not shadowing. The |
Technically for typescript there's 2 and a half scopes - variables, types, and variable types (enums and classes I think are the only two that fit into this). Correct me if I'm wrong - but If that works correctly, then |
No. classes and enums just belong to both at the same time. There is not the third kind of namespaces. After the correct scope analysis arrived, |
Example code:
A rule could ban instances where a generic type variable is introduced with the same name as one in the enclosing scope. Related to #54
The text was updated successfully, but these errors were encountered: