-
-
Notifications
You must be signed in to change notification settings - Fork 498
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(lint/noRedeclare): handle function and call overloads #2615
Conversation
@@ -137,6 +137,7 @@ impl AnyJsBindingDeclaration { | |||
| AnyJsBindingDeclaration::TsModuleDeclaration(_) | |||
| AnyJsBindingDeclaration::TsTypeParameter(_), | |||
AnyJsBindingDeclaration::JsFunctionDeclaration(_) | |||
| AnyJsBindingDeclaration::JsFunctionExportDefaultDeclaration(_) |
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.
This change fixes #2372
@@ -334,6 +335,7 @@ impl SemanticEventExtractor { | |||
| TS_TYPE_ALIAS_DECLARATION | |||
| TS_DECLARE_FUNCTION_DECLARATION | |||
| TS_DECLARE_FUNCTION_EXPORT_DEFAULT_DECLARATION | |||
| TS_CALL_SIGNATURE_TYPE_MEMBER |
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.
This change fixes #2608 by creating a scope for every call signature.
if let Some(function_scope) = scope.parent() { | ||
for binding in function_scope.bindings() { | ||
let id_binding = binding.tree(); | ||
if let Some(decl) = id_binding.declaration() { | ||
let name = id_binding.text(); | ||
declarations.insert(name, (id_binding.syntax().text_trimmed_range(), decl)); | ||
} | ||
} | ||
} |
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 fixed #2394 by adding every parameter and every type parameter in declarations
.
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
CodSpeed Performance ReportMerging #2615 will improve performances by 7.09%Comparing Summary
Benchmarks breakdown
|
Summary
Fix #2608
Fix #2394
Fix #2372
Test Plan
I added a non-regression test for each issue.