Custom Inspection Rule
I am writing an PHP MVC application, that is using Bootstrap 4. I would like to check if all my <a> tags with the class btn have the role="button" attribute.
Is there a way to create such an inspection?
Please sign in to leave a comment.
You can try the following template:
where
text/regexp for $class$ is class, min and max counts are 1
text/regexp for $value$ is ^(.*?(\bbtn\b)[^$]*)$, min and max counts are 1
text/regexp for $role$ is role, min and max counts are 0
text/regexp for $button$ is button, min and max counts are 1
text/regexp for $text$ is empty, min and max counts are 0 and 1 respectively
WOW! You just blew my mind!