Skip to content
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

SONARHTML-270 Update rule metadata #338

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "CODE_SMELL",
"code": {
"impacts": {
"MAINTAINABILITY": "HIGH"
"MAINTAINABILITY": "BLOCKER"
},
"attribute": "LAWFUL"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>This rule is deprecated; use {rule:Web:ChildElementIllegalCheck} instead.</p>
<p>This rule is deprecated; use {rule:Web:S1931} instead.</p>
<h2>Why is this an issue?</h2>
<p>Checker for illegal parent element.</p>
<p>E.g.: title must not have parent element body.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
546
]
},
"quickfix": "unknown"
"quickfix": "infeasible"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ <h2>Why is this an issue?</h2>
default language of a document.</p>
<p>It enables assistive technologies, such as screen readers,&nbsp;to provide a comfortable reading experience by adapting the pronunciation and
accent to the language. It also helps braille translation software, telling it to switch the control codes for accented characters for instance.</p>
<p>Other benefits of marking the language include:</p>
<ul>
<li> assisting user agents in providing dictionary definitions or helping users benefit from translation tools. </li>
<li> improving <a href="https://blogs.bing.com/webmaster/March-2011/How-To-Tell-Bing-Your-Website-s-Country-and-Langua">search engine ranking</a>.
</li>
</ul>
<p>Other benefits of marking the language include assisting user agents in providing dictionary definitions or helping users benefit from translation
tools.</p>
<p>Both the <code>lang</code> and the <code>xml:lang</code> attributes can take only one value.</p>
<p>&nbsp;</p>
<h3>Noncompliant code example</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ <h2>Why is this an issue?</h2>
technologies like screen readers.</p>
<p>For example, a <code>&lt;button&gt;</code> element has a default role of <code>button</code>. If you explicitly define the role of a
<code>&lt;button&gt;</code> element as <code>button</code>, it’s considered redundant because it’s the default role of that element.</p>
<h2>How to fix it in JSX</h2>
<p>Remove redundant ARIA role attribute.</p>
<h3>Code examples</h3>
<h4>Noncompliant code example</h4>
<pre data-diff-id="1" data-diff-type="noncompliant">
&lt;button role="button" onClick={handleClick}&gt;OK&lt;/button&gt;
</pre>
<h4>Compliant solution</h4>
<p>Remove ARIA role attributes when they are redundant.</p>
<pre data-diff-id="1" data-diff-type="compliant">
&lt;button onClick={handleClick}&gt;OK&lt;/button&gt;
</pre>
<h2>Resources</h2>
<h3>Documentation</h3>
<ul>
<li> MDN web docs - <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques">Using ARIA: Roles, states, and
properties</a> </li>
<li> MDN web docs - <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles">ARIA roles (Reference)</a> </li>
</ul>
<h3>Standards</h3>
<ul>
<li> W3C - <a href="https://www.w3.org/TR/wai-aria-1.2/">Accessible Rich Internet Applications (WAI-ARIA) 1.2</a> </li>
</ul>

2 changes: 1 addition & 1 deletion sonarpedia.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languages": [
"HTML"
],
"latest-update": "2024-04-19T15:10:59.766847500Z",
"latest-update": "2024-11-26T09:52:26.195460Z",
"options": {
"no-language-in-filenames": true,
"preserve-filenames": true
Expand Down