Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the require-data-selectors rule customizable #76

Open
sandra-ouadghiri opened this issue Feb 12, 2021 · 0 comments
Open

Make the require-data-selectors rule customizable #76

sandra-ouadghiri opened this issue Feb 12, 2021 · 0 comments

Comments

@sandra-ouadghiri
Copy link

sandra-ouadghiri commented Feb 12, 2021

Today
We can activate this rule, and confiure if warn or error

Proposal
It would be nice to be able to add an optinal second argument to the rule, specifying the attribute name.
It could be :
"cypress/require-data-selectors": {"warn","data-qa"}
Or :
"cypress/require-data-selectors": ["warn","attr-qa"]

This would have the following behaviour

  • If not specified, today behavoiur (data-* is ok, anything else is KO)
  • If specified it is used as it (selector should start with [parameter, such as [data-qa *= or [attr-id-test $= or ...)

This would allow team to check it's not based on [data-ga for ex, but also to allow for people using dedicated attributes, but not following w3c (attr-* instead of data-*) to still take advantage of this rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants