reactjs / react-a11y

Identifies accessibility issues in your React.js elements
MIT License
2.34k stars 126 forks source link

avoid-positive-tabindex error #157

Closed crswll closed 5 years ago

crswll commented 5 years ago

I was getting an error about avoid-positive-tabindex and many warnings after the renaming of the rules minor patch (which maybe should have been a major, especially due to #145).

I wanted to open this issue as more of a help document than a bug report since figuring out the new names wasn't very simple.

Here goes the adjustments I needed to make in order to get rid of the warnings and fix the error:

Original

'avoid-positive-tabindex': 'warn',
'button-role-space': 'warn',
'hidden-uses-tabindex': 'warn',
'img-uses-alt': 'warn',
'label-uses-for': 'warn',
'mouse-events-map-to-key-events': 'warn',
'no-access-key': 'warn',
'no-hash-ref': 'warn',
'no-unsupported-elements-use-aria': 'warn',
'onclick-uses-role': 'warn',
'onclick-uses-tabindex': 'warn',
'redundant-alt': 'warn',
'tabindex-uses-button': 'warn',
'use-onblur-not-onchange': 'warn',
'valid-aria-role': 'warn',

Updated

'tabindex-no-positive': 'warn',
'click-events-have-key-events': 'warn',
'hidden-uses-tabindex': 'warn',
'img-uses-alt': 'warn',
'label-has-for': 'warn',
'mouse-events-have-key-events': 'warn',
'no-access-key': 'warn',
'no-hash-ref': 'warn',
'aria-unsupported-elements': 'warn',
'onclick-uses-role': 'warn',
'interactive-supports-focus': 'warn',
'img-redundant-alt': 'warn',
'tabindex-uses-button': 'warn',
'no-onchange': 'warn',
'aria-role': 'warn',

Here's a quick diff: screen shot 2018-11-26 at 11 07 36 am

erin-doyle commented 5 years ago

Yeah I apologize if this update was not smooth. I was planning to bundle these changes along with some others to make a major but then had a bug fix to put out in the meantime. I thought simply deprecating the old rules with warnings would be a gentle way to inform people of the upgrade path but apparently that was not the experience. I can look into a way to document this better.

erin-doyle commented 5 years ago

I've added a mapping of old to new rules in the README. Hopefully that is more helpful!