diff --git a/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S1451.json b/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S1451.json index 80a4d6612c7..ff961888fef 100644 --- a/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S1451.json +++ b/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S1451.json @@ -8,13 +8,13 @@ "file-for-rules:S3812.ts": [ 0 ], -"file-for-rules:S6551.ts": [ +"file-for-rules:S5254.tsx": [ 0 ], -"file-for-rules:S6583.ts": [ +"file-for-rules:S6551.ts": [ 0 ], -"file-for-rules:S6849.tsx": [ +"file-for-rules:S6583.ts": [ 0 ] } diff --git a/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S5254.json b/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S5254.json new file mode 100644 index 00000000000..cb99b16d21a --- /dev/null +++ b/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S5254.json @@ -0,0 +1,5 @@ +{ +"file-for-rules:S5254.tsx": [ +2 +] +} diff --git a/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S6849.json b/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S6849.json deleted file mode 100644 index 67cd5ca1550..00000000000 --- a/its/ruling/src/test/expected/jsts/file-for-rules/typescript-S6849.json +++ /dev/null @@ -1,5 +0,0 @@ -{ -"file-for-rules:S6849.tsx": [ -2 -] -} diff --git a/its/sources/jsts/custom/S6849.tsx b/its/sources/jsts/custom/S5254.tsx similarity index 100% rename from its/sources/jsts/custom/S6849.tsx rename to its/sources/jsts/custom/S5254.tsx diff --git a/packages/jsts/src/rules/S6849/cb.fixture.tsx b/packages/jsts/src/rules/S5254/cb.fixture.tsx similarity index 100% rename from packages/jsts/src/rules/S6849/cb.fixture.tsx rename to packages/jsts/src/rules/S5254/cb.fixture.tsx diff --git a/packages/jsts/src/rules/S6849/cb.test.ts b/packages/jsts/src/rules/S5254/cb.test.ts similarity index 97% rename from packages/jsts/src/rules/S6849/cb.test.ts rename to packages/jsts/src/rules/S5254/cb.test.ts index 02cc6551d72..0f9b68328c7 100644 --- a/packages/jsts/src/rules/S6849/cb.test.ts +++ b/packages/jsts/src/rules/S5254/cb.test.ts @@ -23,6 +23,6 @@ import path from 'path'; const sonarId = path.basename(__dirname); -describe('Rule S6849', () => { +describe('Rule 5254', () => { check(sonarId, rule, __dirname); }); diff --git a/packages/jsts/src/rules/S6849/index.ts b/packages/jsts/src/rules/S5254/index.ts similarity index 100% rename from packages/jsts/src/rules/S6849/index.ts rename to packages/jsts/src/rules/S5254/index.ts diff --git a/packages/jsts/src/rules/S6849/rule.ts b/packages/jsts/src/rules/S5254/rule.ts similarity index 96% rename from packages/jsts/src/rules/S6849/rule.ts rename to packages/jsts/src/rules/S5254/rule.ts index 364f2c17aca..8e3ee72d532 100644 --- a/packages/jsts/src/rules/S6849/rule.ts +++ b/packages/jsts/src/rules/S5254/rule.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// https://sonarsource.github.io/rspec/#/rspec/S6849/javascript +// https://sonarsource.github.io/rspec/#/rspec/S5254/javascript import { TSESTree } from '@typescript-eslint/utils'; import { Rule } from 'eslint'; diff --git a/packages/jsts/src/rules/index.ts b/packages/jsts/src/rules/index.ts index 66e965899f8..34af3cb6196 100644 --- a/packages/jsts/src/rules/index.ts +++ b/packages/jsts/src/rules/index.ts @@ -104,7 +104,7 @@ import { rule as S3531 } from './S3531'; // generator-without-yield import { rule as S4790 } from './S4790'; // hashing import { rule as S5691 } from './S5691'; // hidden-files import { rule as S6754 } from './S6754'; // hook-use-state -import { rule as S6849 } from './S6849'; // html-has-lang +import { rule as S5254 } from './S5254'; // html-has-lang import { rule as S3785 } from './S3785'; // in-operator-type-error import { rule as S3686 } from './S3686'; // inconsistent-function-call import { rule as S2692 } from './S2692'; // index-of-compare-to-positive-number @@ -400,7 +400,7 @@ rules['generator-without-yield'] = S3531; rules['hashing'] = S4790; rules['hidden-files'] = S5691; rules['hook-use-state'] = S6754; -rules['html-has-lang'] = S6849; +rules['html-has-lang'] = S5254; rules['in-operator-type-error'] = S3785; rules['inconsistent-function-call'] = S3686; rules['index-of-compare-to-positive-number'] = S2692; diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HtmlHasLangCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HtmlHasLangCheck.java index 3d20660b928..f7015a7eca4 100644 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HtmlHasLangCheck.java +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HtmlHasLangCheck.java @@ -23,10 +23,12 @@ import org.sonar.plugins.javascript.api.EslintBasedCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; @TypeScriptRule @JavaScriptRule -@Rule(key = "S6849") +@DeprecatedRuleKey(ruleKey = "S6849") +@Rule(key = "S5254") public class HtmlHasLangCheck implements EslintBasedCheck { @Override diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6849.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.html similarity index 100% rename from sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6849.html rename to sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.html diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6849.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.json similarity index 96% rename from sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6849.json rename to sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.json index 510b80e1276..f49d27f0897 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6849.json +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.json @@ -12,7 +12,7 @@ ], "defaultSeverity": "Minor", "ruleSpecification": "RSPEC-6849", - "sqKey": "S6849", + "sqKey": "S5254", "scope": "All", "quickfix": "targeted", "code": { diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/Sonar_way_profile.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/Sonar_way_profile.json index 114c8155df0..c5821a82d49 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/Sonar_way_profile.json +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/Sonar_way_profile.json @@ -321,7 +321,7 @@ "S6846", "S6847", "S6848", - "S6849", + "S5254", "S6850", "S6851", "S6852",