-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
It appears that PR #1340 introduced a change when reservedFirst is enabled such that it conflicts with the option callbacksLast. When this option is enabled, ESLint wants callbacks to be sorted alphabetically with respect to the rest of the properties. The following will incorrectly generate an error:
eslintrc:
{
"rules": {
"react/jsx-sort-props": ["error", {
"callbacksLast": true,
"reservedFirst": true
}]
}
}<button
className={className}
disabled={disabled}
type="button"
onClick={this.onClick}
>
Submit
</button>Notice that onClick occurs after type, which should be the case given the rule configuration. However, the change in this PR made it to where the React plugin wants onClick to appear before type, effectively disabling the entire callbacksLast rule.
I have confirmed that reverting jsx-sort-props.js fixes this bug, but obviously that is not ideal because the alphabetic sorting fix in that PR is also desirable.
kolpax