Jump to conversation
Unresolved conversations (1)
@ljharb ljharb Jul 21, 2022
```suggestion if ( isHiddenFromScreenReader( elementType(node.openingElement), node.openingElement.attributes ) ) { return ''; } ```
Outdated
src/util/getAccessibleChildText.js
ljharb mattxwang
Resolved conversations (12)
@ljharb ljharb Jul 21, 2022
can you add a valid test using `components` as well?
..._/src/rules/anchor-ambiguous-text-test.js
@ljharb ljharb Jul 21, 2022
these, and the options extraction, should be done at the top level of `create` to avoid having to do so every time the node is visited.
Outdated
src/rules/anchor-ambiguous-text.js
@ljharb ljharb Jul 19, 2022
```suggestion context.report({ node, message: 'Ambiguous text within anchor. Screenreader users rely on link text for context; the words "{{wordsList}}" are ambiguous and do not provide enough context.', data: { wordsList: words.join('", "'), }, ```
Outdated
src/rules/anchor-ambiguous-text.js
@gaurav5430 gaurav5430 Jul 13, 2022
how are you able to use type annotations in js files ?
Outdated
src/rules/anchor-ambiguous-text.js
ljharb
@ljharb ljharb Jul 13, 2022
```suggestion if (child.type === 'Literal' || child.type === 'JSXText) { return str + child.value; } return str; ``` switch statements should be avoided :-)
Outdated
src/rules/anchor-ambiguous-text.js
@gaurav5430 gaurav5430 Jul 13, 2022
we can allow passing this list as an option as well , and fallback to this as default ?
Outdated
src/rules/anchor-ambiguous-text.js
mattxwang
@ljharb ljharb Jul 13, 2022
this error message won't contain the right words if the config specifies its own words
Outdated
src/rules/anchor-ambiguous-text.js
ljharb mattxwang
@ljharb ljharb Jul 13, 2022
adding a new rule to a config is a breaking change, so we can't do that here. ```suggestion 'jsx-a11y/anchor-ambiguous-text': 'off', // TODO: error ```
Outdated
src/index.js
ljharb mattxwang
@gaurav5430 gaurav5430 Jul 13, 2022
just checking that the text content matches any of the ambiguous text might not be enough, as the author might have already catered for this by adding an aria-label which explains things more clearly.
src/rules/anchor-ambiguous-text.js
mattxwang
@ljharb ljharb Jul 13, 2022
why only additional? what if someone doesn't want the default words?
Outdated
docs/rules/anchor-ambiguous-text.md
mattxwang
@ljharb ljharb Jul 13, 2022
```suggestion "jsx-a11y/img-redundant-alt": [2, { "words": ["click this"], ```
Outdated
docs/rules/anchor-ambiguous-text.md
@gaurav5430 gaurav5430 Jul 13, 2022
do we need to take care of JSXElement here ? ``` <a ...> Click <span> here </span> </a> ```
Outdated
src/rules/anchor-ambiguous-text.js
mattxwang gaurav5430