diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1090.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1090.json index c42d3cb1706..513c2d5d9bf 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1090.json +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S1090.json @@ -11,7 +11,7 @@ "react" ], "defaultSeverity": "Minor", - "ruleSpecification": "RSPEC-6854", + "ruleSpecification": "RSPEC-1090", "sqKey": "S1090", "scope": "All", "quickfix": "infeasible", diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S2699.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S2699.html index f1a5d37d33e..86f546bb099 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S2699.html +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S2699.html @@ -8,8 +8,13 @@

Why is this an issue?

Without assertions, a unit test doesn’t actually verify anything, making it ineffective in catching potential bugs or regressions. It will always pass, regardless of the implementation of the unit. This can lead to a false sense of security, as you may believe that your code is working correctly when it might not be.

-

This rule raises an issue when the assertion library chai,sinon or vitest is imported but no assertion is -used in a test.

+

This rule raises an issue when one of the following assertion libraries is imported but no assertion is used in a test:

+
 const expect = require("chai").expect;
 
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S4084.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S4084.json
index 4bb2283ecc2..78de4665b06 100644
--- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S4084.json
+++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S4084.json
@@ -11,7 +11,7 @@
     "react"
   ],
   "defaultSeverity": "Minor",
-  "ruleSpecification": "RSPEC-6855",
+  "ruleSpecification": "RSPEC-4084",
   "sqKey": "S4084",
   "scope": "All",
   "quickfix": "infeasible",
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.json
index f49d27f0897..a4e23daf68c 100644
--- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.json
+++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5254.json
@@ -11,7 +11,7 @@
     "react"
   ],
   "defaultSeverity": "Minor",
-  "ruleSpecification": "RSPEC-6849",
+  "ruleSpecification": "RSPEC-5254",
   "sqKey": "S5254",
   "scope": "All",
   "quickfix": "targeted",
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5867.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5867.html
index 9fdb27b676b..0b1bf895700 100644
--- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5867.html
+++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5867.html
@@ -1,7 +1,7 @@
 

Why is this an issue?

JavaScript regular expressions provide Unicode character classses and Unicode property escapes for matching characters based on their Unicode values and Unicode properties respectively. When using Unicode property escapes like \p{Alpha} without the u flag, the -regular expression will not match alphabetic characters but rather the +'\p{Alpha}+' string literal, which is likely a mistake.

+regular expression will not match alphabetic characters but rather the '\p{Alpha}' string literal, which is likely a mistake.

This rules raises an issue when Unicode character classses and Unicode property escapes are used without the u flag.

Noncompliant code example

diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6807.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6807.html
index 304dd7cba71..6576ed42c8d 100644
--- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6807.html
+++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6807.html
@@ -6,7 +6,7 @@ 

Why is this an issue?

For example, if an element has a role of "checkbox", it must also include the aria-checked property. This property indicates whether the checkbox is checked (true), unchecked (false), or in a mixed state (mixed).

This rule checks that each element with a defined ARIA role also has all required attributes.

-

How to fix it in JSX

+

How to fix it

Check that each element with a defined ARIA role also has all required attributes.

 <div role="checkbox">Unchecked</div> {/* Noncompliant: aria-checked is missing */}
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6811.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6811.html
index cb70fc6a5af..b6873206db4 100644
--- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6811.html
+++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6811.html
@@ -7,12 +7,12 @@ 

Why is this an issue?

This rule ensures that the ARIA properties used on an element are ones that are supported by the role of that element. For instance, the ARIA property aria-required is not supported by the role link. Therefore, using aria-required on an anchor tag would violate this rule.

-

How to fix it in JSX

-

Check the spelling of the aria-* attributes and verify that they are actually supported by the element role.

 <div role="checkbox" aria-chekd={isChecked}>Unchecked</div> {/* Noncompliant: aria-chekd is not supported */}
 
-

To fix the code remove non-compatible attributes or replace them with the correct ones.

+

How to fix it

+

Check the spelling of the aria-* attributes and verify that they are actually supported by the element role. Remove non-compatible attributes or +replace them with the correct ones.

 <div role="checkbox" aria-checked={isChecked}>Unchecked</div>
 
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6819.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6819.html index 661cdc09d36..aec6946c44d 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6819.html +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6819.html @@ -8,14 +8,10 @@

Why is this an issue?

assistive technologies, simplicity, and maintainability. They come with inherent behaviors and keyboard interactions, reducing the need for additional JavaScript. Semantic HTML also enhances SEO by helping search engines better understand the content and structure of web pages. While ARIA roles are useful, they should be considered a last resort when no suitable HTML element can provide the required behavior or semantics.

-

How to fix it in JSX

-

Replace the ARIA role with an appropriate HTML tag.

-

Code examples

-

Noncompliant code example

-<div role="button" onClick={handleClick}>Click me</div>
+<div role="button" onClick={handleClick} /* Noncompliant */>Click me</div>
 
-

Compliant solution

+

Replace the ARIA role with an appropriate HTML tag.

 <button onClick={handleClick}>Click me</button>
 
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6821.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6821.html index b47026920f8..0a2aaafdfec 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6821.html +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6821.html @@ -3,7 +3,7 @@

Why is this an issue?

provide additional information about an element’s role, state, properties, and values to assistive technologies like screen readers.

This rule checks that when using the role property in DOM elements, its value is a valid non-abstract ARIA role.

This rule does not cover non-DOM elements, such as custom components.

-

How to fix it in JSX

+

How to fix it

Check that each element with a defined ARIA role has a valid non-abstract value.

 <div role="meth" aria-label="a^{2} + b^{2} = c^{2}">
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6822.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6822.html
index 1a52f9c205d..332fa707794 100644
--- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6822.html
+++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6822.html
@@ -6,14 +6,10 @@ 

Why is this an issue?

technologies like screen readers.

For example, a <button> element has a default role of button. If you explicitly define the role of a <button> element as button, it’s considered redundant because it’s the default role of that element.

-

How to fix it in JSX

-

Remove redundant ARIA role attribute.

-

Code examples

-

Noncompliant code example

 <button role="button" onClick={handleClick}>OK</button>
 
-

Compliant solution

+

Remove ARIA role attributes when they are redundant.

 <button onClick={handleClick}>OK</button>
 
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6824.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6824.html index 4bdd2b6e514..33c59168e67 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6824.html +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6824.html @@ -3,7 +3,7 @@

Why is this an issue?

provide additional information about an element’s role, state, properties, and values to assistive technologies like screen readers.

This rule checks that ARIA roles or aria-* attributes are not used in unsupported DOM elements, which are mostly invisible such as meta, html or head.

-

How to fix it in JSX

+

How to fix it

Check if you are using ARIA roles or aria-* attributes in unsupported DOM elements.

 <title aria-hidden="false">My beautiful web page</title>
diff --git a/sonarpedia.json b/sonarpedia.json
index 109e3ca10a4..bcdc8284017 100644
--- a/sonarpedia.json
+++ b/sonarpedia.json
@@ -3,7 +3,7 @@
   "languages": [
     "JS"
   ],
-  "latest-update": "2024-03-28T12:38:08.293231Z",
+  "latest-update": "2024-04-23T12:50:58.369617900Z",
   "options": {
     "no-language-in-filenames": true,
     "preserve-filenames": true