> getAllChecks() {
AlertUseCheck.class,
AlphabeticalSortCheck.class,
AlwaysUseCurlyBracesCheck.class,
+ AnchorHasContentCheck.class,
AnchorPrecedenceCheck.class,
AngleBracketTypeAssertionCheck.class,
ArgumentTypesCheck.class,
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6827.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6827.html
new file mode 100644
index 00000000000..35a5a50e684
--- /dev/null
+++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6827.html
@@ -0,0 +1,33 @@
+Why is this an issue?
+ARIA (Accessible Rich Internet Applications) is a set of attributes that define ways to make web content and web applications more accessible to
+people with disabilities. The 'aria-hidden' attribute is used to indicate that an element and all of its descendants are not visible or perceivable to
+any user as implemented by assistive technologies.
+However, when 'aria-hidden' is used on a focusable element, it can create a confusing and inaccessible experience for screen reader users. This is
+because the element will still be included in the tab order, so a screen reader user can navigate to it, but it will not be announced by the screen
+reader due to the 'aria-hidden' attribute.
+This rule ensures that focusable elements are not hidden from screen readers using the 'aria-hidden' attribute.
+How to fix it
+Check if the element is focusable. Focusable elements should not have 'aria-hidden' attribute.
+Code examples
+Noncompliant code example
+
+<button aria-hidden="true">Click me</button>
+
+Remove 'aria-hidden' attribute.
+Compliant solution
+
+<button>Click me</button>
+
+Resources
+Documentation
+
+Standards
+
+
diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6827.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6827.json
new file mode 100644
index 00000000000..f2d80f5cf68
--- /dev/null
+++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S6827.json
@@ -0,0 +1,30 @@
+{
+ "title": "Anchors should contain accessible content",
+ "type": "CODE_SMELL",
+ "status": "ready",
+ "remediation": {
+ "func": "Constant\/Issue",
+ "constantCost": "5min"
+ },
+ "tags": [
+ "react",
+ "accessibility"
+ ],
+ "defaultSeverity": "Minor",
+ "ruleSpecification": "RSPEC-6827",
+ "sqKey": "S6827",
+ "scope": "All",
+ "defaultQualityProfiles": ["Sonar way"],
+ "quickfix": "infeasible",
+ "code": {
+ "impacts": {
+ "MAINTAINABILITY": "LOW",
+ "RELIABILITY": "LOW"
+ },
+ "attribute": "CONVENTIONAL"
+ },
+ "compatibleLanguages": [
+ "JAVASCRIPT",
+ "TYPESCRIPT"
+ ]
+}
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 69a681f8421..45ead7c2f7c 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
@@ -299,6 +299,7 @@
"S6822",
"S6823",
"S6824",
- "S6825"
+ "S6825",
+ "S6827"
]
}
diff --git a/typings/jsx-ast-utils/index.d.ts b/typings/jsx-ast-utils/index.d.ts
new file mode 100644
index 00000000000..8d5a9e17382
--- /dev/null
+++ b/typings/jsx-ast-utils/index.d.ts
@@ -0,0 +1,3 @@
+declare module 'jsx-ast-utils' {
+ export const hasAnyProp: (any, any) => boolean;
+}