Skip to content

Commit

Permalink
fix(eslint-plugin): make sorting order consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
susisu committed Dec 21, 2020
1 parent 5fd2fcb commit 77c36ce
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -53,11 +53,14 @@ function createValidator(
return -1;
}

const aIsMethodOrProperty = isMethodOrPropertySelector(a.selector);
const bIsMethodOrProperty = isMethodOrPropertySelector(b.selector);

// for backward compatibility, method and property have higher precedence than other meta selectors
if (isMethodOrPropertySelector(a.selector)) {
if (aIsMethodOrProperty && !bIsMethodOrProperty) {
return -1;
}
if (isMethodOrPropertySelector(b.selector)) {
if (!aIsMethodOrProperty && bIsMethodOrProperty) {
return 1;
}

Expand Down

0 comments on commit 77c36ce

Please sign in to comment.