-
Notifications
You must be signed in to change notification settings - Fork 176
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
Deprecate S2814 (no-redeclare
) for TypeScript
#3635
Conversation
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.
And won't fix the issue in Next
@@ -49,7 +50,10 @@ public void define(Context context) { | |||
NewRule commentRegularExpression = repository.rule("S124"); | |||
commentRegularExpression.setTemplate(true); | |||
|
|||
// deprecated for Typescript: https://github.com/SonarSource/SonarJS/issues/3580 | |||
NewRule redeclaredVariables = repository.rule("S2814"); |
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.
for the variable name use eslint key or java class name
@@ -95,6 +95,7 @@ void sonar_way_ts() { | |||
assertThat(profile.rules()).extracting("repoKey").containsOnly(CheckList.TS_REPOSITORY_KEY); | |||
assertThat(profile.rules().size()).isGreaterThan(100); | |||
assertThat(profile.rules()).extracting(BuiltInQualityProfilesDefinition.BuiltInActiveRule::ruleKey).contains("S5122"); | |||
assertThat(profile.rules()).extracting(BuiltInQualityProfilesDefinition.BuiltInActiveRule::ruleKey).doesNotContain("S2814"); |
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.
Assert that JS profile has it
@@ -49,7 +50,10 @@ public void define(Context context) { | |||
NewRule commentRegularExpression = repository.rule("S124"); | |||
commentRegularExpression.setTemplate(true); | |||
|
|||
// deprecated for Typescript: https://github.com/SonarSource/SonarJS/issues/3580 | |||
NewRule redeclaredVariables = repository.rule("S2814"); | |||
redeclaredVariables.setStatus(RuleStatus.DEPRECATED); |
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.
can we unit test it?
SonarQube Quality Gate |
no-redeclare
) for TypeScript
This reverts commit 4c0766e.
Fixes #3580
Note: we failed to add
Deprecated
section to the rule description