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

Support multiple test attributes #19

Closed KhaledMohamedP closed 1 year ago

KhaledMohamedP commented 1 year ago

This PR addresses this issue here https://github.com/davidcalhoun/eslint-plugin-test-selectors/issues/16

Support multiple test attributes

Screenshot 2023-08-03 at 9 01 32 PM
{
  "rules": {
    "test-selectors/button": [
      "warn",
      "always",
      { "htmlOnly": true, "testAttribute": ["data-testid", "testId"] }
    ]
}
anichols-ht commented 1 year ago

This seems reasonable to me, but I'll wait for @davidcalhoun to give the final go.

davidcalhoun commented 1 year ago

Great, thank you for the PR! Looks ok on first glance, I haven't had a chance to test it out yet.