Skip to content

Commit c19c37b

Browse files
jamesgeorge007ota-meshi
authored andcommitted
refactor: use Array.includes() to check for existence (#1013)
* refactor: use includes * fix: typo
1 parent ec94d6a commit c19c37b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rules/order-in-components.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ function isNotSideEffectsNode (node, visitorKeys) {
118118
node.type !== 'Property' &&
119119
node.type !== 'ObjectExpression' &&
120120
node.type !== 'ArrayExpression' &&
121-
(node.type !== 'UnaryExpression' || ['!', '~', '+', '-', 'typeof'].indexOf(node.operator) < 0) &&
122-
(node.type !== 'BinaryExpression' || ALL_BINARY_OPERATORS.indexOf(node.operator) < 0) &&
123-
(node.type !== 'LogicalExpression' || LOGICAL_OPERATORS.indexOf(node.operator) < 0) &&
121+
(node.type !== 'UnaryExpression' || !['!', '~', '+', '-', 'typeof'].includes(node.operator)) &&
122+
(node.type !== 'BinaryExpression' || !ALL_BINARY_OPERATORS.includes(node.operator)) &&
123+
(node.type !== 'LogicalExpression' || !LOGICAL_OPERATORS.includes(node.operator)) &&
124124
node.type !== 'MemberExpression' &&
125125
node.type !== 'ConditionalExpression' &&
126126
// es2015

0 commit comments

Comments
 (0)