You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
/* … beginning of component definition, not important for this issue … */constaltText='Share with Facebook'return(<ahref={shareUrl}title={altText}target="_blank"rel="noopener noreferrer"{...props}><svgaria-hiddenxmlns="http://www.w3.org/2000/svg"viewBox="0 0 9 18"><pathd="M8.4 5.9H5.58V4.33c0-.8.09-1.24 1.25-1.24h1.55V0H5.9C2.9 0 1.86 1.5 1.86 4.03V5.9H0V9h1.86v9H5.6V9h2.48l.33-3.1z"/></svg><VisuallyHidden>{altText}</VisuallyHidden></a>)/* … ending component definition, not important for this issue … */
with tslint.json configuration:
{"defaultSeverity": "error","extends": ["tslint:recommended","tslint-react","tslint-react-a11y",// <-- this is where tslint-microsoft-contrib is being referenced from"tslint-config-prettier","tslint-react-hooks"],// other unimportant stuff to this issue …
Actual behavior
Linting error is being thrown with message
Link content can not be hidden for screen-readers by using aria-hidden attribute.
Expected behavior
As the link has an accessible text that screenreaders can access and read (via <VisuallyHidden>{altText}</VisuallyHidden>) I would expect that such an error shouldn’t occur.
The text was updated successfully, but these errors were encountered:
The answer to the second question is yes. :-) But VisuallyHidden is not necessary for the issue, the false positive also shows up when you write {altText} instead of <VisuallyHidden>{altText}</VisuallyHidden>.
TSLint is deprecated and no longer accepting pull requests other than security fixes. See #876. ☠️
We recommend you instead use typescript-eslint to lint your TypeScript code with ESLint. ✅
Bug Report
tslint-microsoft-contrib
version: 6.2.0TypeScript code being linted
with
tslint.json
configuration:Actual behavior
Linting error is being thrown with message
Expected behavior
As the link has an accessible text that screenreaders can access and read (via
<VisuallyHidden>{altText}</VisuallyHidden>
) I would expect that such an error shouldn’t occur.The text was updated successfully, but these errors were encountered: