-
Notifications
You must be signed in to change notification settings - Fork 657
fix(rome_js_analyze): suppress noUnusedVariables's false positive diagnostics when using indexed type #4647
Conversation
✅ Deploy Preview for docs-rometools canceled.
|
@@ -25,6 +25,5 @@ | |||
"function f() { var a; if (test) { var a; } }", | |||
"for (var a, a;;);", | |||
"for (;;){ var a, a,;}", | |||
"function f(x) { var x = 5; }", | |||
"interface A { [index: number]: string; [index: number]: string; }" |
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.
Semantic analyzer no longer handle identifiers of type variable, so I removed.
In this case, tsc throw the syntax error.
Thus, I seem that it is better to make this rule in syntax rule like noDuplicatePrivateClassMembers.
redeclarations.push(Redeclaration { | ||
name, | ||
declaration: *first_text_range, | ||
redeclaration: id_binding.syntax().text_trimmed_range(), | ||
}) |
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 rule no longer handles the case like interface A { [index: number]: string; [index: number]: string; }
, so I removed unnecessary logic.
… TsIndexSignatureParameter
@@ -2066,9 +2066,11 @@ TsIndexSignatureTypeMember = | |||
// { [a: string]: number } | |||
// ^^^^^^^^^ | |||
TsIndexSignatureParameter = | |||
binding: JsIdentifierBinding | |||
binding: TsIndexSignatureParameterName |
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 introduce the new CST node for the binding of TsIndexSignatureParameter. I think this binding is not JsIdentifierBinding.
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
🔥 Regression (28):
ts/babel
ts/microsoft
|
This PR doesn't pass some tests, so I will rework and create the another PR. |
Summary
Fix #4634
Test Plan
I update some snapshot tests.