davidcalhoun / eslint-plugin-test-selectors

Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.
28 stars 14 forks source link

Don't error for `readonly` or `disabled` by default #3

Closed wesleytodd closed 5 years ago

wesleytodd commented 5 years ago

I think it would be good to exclude elements with readonly or disabled by default with the ability to turn it on. I am using input's for displaying some non-editable information and this lint rule set errors on them. One other option would be to not error on input without an onChange, but I am not sure which would be better and more robust.

davidcalhoun commented 5 years ago

Great suggestion, thanks! For your second option, it may in any case be useful to support this. I think I forgot to capture your feedback previously about warnings vs errors, which might help this. Created a ticket to track it: https://github.com/davidcalhoun/eslint-plugin-test-selectors/issues/4

wesleytodd commented 5 years ago

Yeah I ended up just disabling it on all but the main files. Even then I ended up disabling the entire anchor rule and about 10% of the other button and input cases.

davidcalhoun commented 5 years ago

Added in 1.1.0: