ratchapong

Reorganize jsx-ally11

Mar 15th, 2022
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const ss = `
  2. accessible-emoji\terror\terror
  3. alt-text\terror\terror
  4. anchor-has-content\terror\terror
  5. anchor-is-valid\terror\terror
  6. aria-activedescendant-has-tabindex\terror\terror
  7. aria-props\terror\terror
  8. aria-proptypes\terror\terror
  9. aria-role\terror\terror
  10. aria-unsupported-elements\terror\terror
  11. autocomplete-valid\terror\terror
  12. click-events-have-key-events\terror\terror
  13. control-has-associated-label\terror\terror
  14. heading-has-content\terror\terror
  15. html-has-lang\terror\terror
  16. iframe-has-title\terror\terror
  17. img-redundant-alt\terror\terror
  18. interactive-supports-focus\terror\terror
  19. label-has-associated-control\terror\terror
  20. label-has-for\terror\terror
  21. lang\terror\terror
  22. media-has-caption\terror\terror
  23. mouse-events-have-key-events\terror\terror
  24. no-access-key\terror\terror
  25. no-autofocus\terror\terror
  26. no-distracting-elements\terror\terror
  27. no-interactive-element-to-noninteractive-role\terror, with options\terror
  28. no-noninteractive-element-interactions\terror, with options\terror
  29. no-noninteractive-element-to-interactive-role\terror, with options\terror
  30. no-noninteractive-tabindex\terror, with options\terror
  31. no-onchange\terror\terror
  32. no-redundant-roles\terror\terror
  33. no-static-element-interactions\terror, with options\terror
  34. role-has-required-aria-props\terror\terror
  35. role-supports-aria-props\terror\terror
  36. scope\terror, with options\terror
  37. tabindex-no-positive\terror\terror
  38. `;
  39. const supported = require('./supported').rules;
  40.  
  41. const allRules = {};
  42. ss.split('\n').forEach((l) => {
  43.   if (l) {
  44.     const n = `jsx-a11y/${l.trim().split('\t')[0]}`;
  45.     allRules[n] = 'Waiting...';
  46.     if (supported[n]) {
  47.       allRules[n] = supported[n];
  48.     }
  49.   }
  50. });
  51.  
  52. // Console.log(supported)
  53. console.log(JSON.stringify(allRules, null, 2));
  54.  
Advertisement
Add Comment
Please, Sign In to add comment