Skip to content

Commit ab0f3c7

Browse files
committed
Simplify error reporting for prefer-both-either
1 parent 67fd1e8 commit ab0f3c7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

rules/prefer-both-either.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@ const elementsToString = R.pipe(
2626
R.join(', ')
2727
);
2828

29-
const report = (instead, args) => `Instead of \`${instead}([${args}])\`, prefer \`${prefer[instead]}(${args})\``
29+
const report = instead => `Instead of \`${instead}\`, prefer \`${prefer[instead]}\` when there are only two predicates`
3030

3131
const create = context => ({
3232
CallExpression(node) {
3333
if (match('allPass')(node) || match('anyPass')(node)) {
3434
const callee = getName(node.callee);
35-
const args = elementsToString(node.arguments[0]);
3635
context.report({
3736
node,
38-
message: report(callee, args)
37+
message: report(callee)
3938
});
4039
}
4140
}

0 commit comments

Comments
 (0)