-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
react/jsx-handler-names should not trigger on "only" #571
Labels
Comments
tkers
changed the title
react/jsx-handler-names triggers on "only"
react/jsx-handler-names should not trigger on "only"
Apr 25, 2016
Yep, maybe it would be more convenient to use a regex (and make it customizable) to check the handler names instead of using a simple prefix like today. |
+1. I often use |
lencioni
added a commit
to lencioni/eslint-plugin-react
that referenced
this issue
Jul 24, 2016
The rule was triggered for a property `only`. This is because the regex was checking for the prefix (by default "on") followed by any characters. We can fix this by ensuring that the prefix we are checking for is always followed by an uppercase character. It was suggested in the issue that we might want to allow this rule to accept a regex, which would allow for more flexibility in how this rule is configured. I think this might be a nice enhancement, but since this fix was so simple I decided to go with the quick and easy win at this time. Fixes jsx-eslint#571
lencioni
added a commit
to lencioni/eslint-plugin-react
that referenced
this issue
Jul 30, 2016
The rule was triggered for a property `only`. This is because the regex was checking for the prefix (by default "on") followed by any characters. We can fix this by ensuring that the prefix we are checking for is always followed by an uppercase character. It was suggested in the issue that we might want to allow this rule to accept a regex, which would allow for more flexibility in how this rule is configured. I think this might be a nice enhancement, but since this fix was so simple I decided to go with the quick and easy win at this time. Fixes jsx-eslint#571
should I open another issue for making this regex configurable so that I can exclude |
@mik01aj yes, I think a separate issue is better |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The rule was triggered for a property
only
. I assume it checks for any prop key starting withon
, but it would maybe make sense changing this to matchon[A-Z]
(i.e. camelcased keys) instead?The text was updated successfully, but these errors were encountered: