Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
12345678910111213141516171819202122232425262728293031323334
  1. # no-distracting-elements
  2. Enforces that no distracting elements are used. Elements that can be visually distracting can cause accessibility issues with visually impaired users. Such elements are most likely deprecated, and should be avoided. By default, the following elements are visually distracting: `<marquee>` and `<blink>`.
  3. #### References
  4. 1. [Deque University](https://dequeuniversity.com/rules/axe/1.1/marquee)
  5. 2. [Deque University](https://dequeuniversity.com/rules/axe/1.1/blink)
  6. ## Rule details
  7. This rule takes one optional object argument of type object:
  8. ```json
  9. {
  10. "rules": {
  11. "jsx-a11y/no-distracting-elements": [ 2, {
  12. "elements": [ "marquee", "blink" ],
  13. }],
  14. }
  15. }
  16. ```
  17. For the `elements` option, these strings determine which JSX elements should be checked for usage. This shouldn't need to be configured unless you have a seriously compelling use case for these elements. You cannot add any additional elements than what is offered, as the schema is only valid with the provided enumerated list. If you have another element that you think may cause a11y issues due to visual impairment, please feel free to file an issue or send a PR!
  18. ### Succeed
  19. ```jsx
  20. <div />
  21. ```
  22. ### Fail
  23. ```jsx
  24. <marquee />
  25. <blink />
  26. ```