Skip to content

Commit

Permalink
refactor: use Array.includes() to check for existence (#1013)
Browse files Browse the repository at this point in the history
* refactor: use includes

* fix: typo
  • Loading branch information
jamesgeorge007 authored and ota-meshi committed Dec 26, 2019
1 parent ec94d6a commit c19c37b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rules/order-in-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ function isNotSideEffectsNode (node, visitorKeys) {
node.type !== 'Property' &&
node.type !== 'ObjectExpression' &&
node.type !== 'ArrayExpression' &&
(node.type !== 'UnaryExpression' || ['!', '~', '+', '-', 'typeof'].indexOf(node.operator) < 0) &&
(node.type !== 'BinaryExpression' || ALL_BINARY_OPERATORS.indexOf(node.operator) < 0) &&
(node.type !== 'LogicalExpression' || LOGICAL_OPERATORS.indexOf(node.operator) < 0) &&
(node.type !== 'UnaryExpression' || !['!', '~', '+', '-', 'typeof'].includes(node.operator)) &&
(node.type !== 'BinaryExpression' || !ALL_BINARY_OPERATORS.includes(node.operator)) &&
(node.type !== 'LogicalExpression' || !LOGICAL_OPERATORS.includes(node.operator)) &&
node.type !== 'MemberExpression' &&
node.type !== 'ConditionalExpression' &&
// es2015
Expand Down

0 comments on commit c19c37b

Please sign in to comment.