Commit 1a1dcdb
committed
Prevent jsx-handler-names from incorrectly flagging
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 #571only
1 parent 2f7a462 commit 1a1dcdb
File tree
2 files changed
+19
-2
lines changed- lib/rules
- tests/lib/rules
2 files changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
| |||
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
104 | 121 | | |
105 | 122 | | |
106 | 123 | | |
| |||
0 commit comments