Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
31
node_modules/eslint/lib/rules/no-mixed-operators.js
generated
vendored
31
node_modules/eslint/lib/rules/no-mixed-operators.js
generated
vendored
|
|
@ -117,7 +117,7 @@ module.exports = {
|
|||
],
|
||||
|
||||
messages: {
|
||||
unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'."
|
||||
unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'. Use parentheses to clarify the intended order of operations."
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -161,17 +161,6 @@ module.exports = {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the operator of a given node is mixed with a
|
||||
* conditional expression.
|
||||
* @param {ASTNode} node A node to check. This is a conditional
|
||||
* expression node
|
||||
* @returns {boolean} `true` if the node was mixed.
|
||||
*/
|
||||
function isMixedWithConditionalParent(node) {
|
||||
return !astUtils.isParenthesised(sourceCode, node) && !astUtils.isParenthesised(sourceCode, node.test);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the operator token of a given node.
|
||||
* @param {ASTNode} node A node to check. This is a BinaryExpression
|
||||
|
|
@ -220,19 +209,13 @@ module.exports = {
|
|||
* @returns {void}
|
||||
*/
|
||||
function check(node) {
|
||||
if (TARGET_NODE_TYPE.test(node.parent.type)) {
|
||||
if (node.parent.type === "ConditionalExpression" && !shouldIgnore(node) && isMixedWithConditionalParent(node.parent)) {
|
||||
reportBothOperators(node);
|
||||
} else {
|
||||
if (TARGET_NODE_TYPE.test(node.parent.type) &&
|
||||
isMixedWithParent(node) &&
|
||||
!shouldIgnore(node)
|
||||
) {
|
||||
reportBothOperators(node);
|
||||
}
|
||||
}
|
||||
if (
|
||||
TARGET_NODE_TYPE.test(node.parent.type) &&
|
||||
isMixedWithParent(node) &&
|
||||
!shouldIgnore(node)
|
||||
) {
|
||||
reportBothOperators(node);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue