Skip to content

Commit 19d2d7c

Browse files
committed
Update ESLint
1 parent 1568bfb commit 19d2d7c

7 files changed

Lines changed: 2905 additions & 1292 deletions

File tree

lib/getComments.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function beforeNode(comments, previousNode, node, currentInitialIndex) {
2323
previousNode.position = node.position;
2424
previousNode.initialIndex = initialIndex - 0.0001;
2525

26-
const newComments = [previousNode].concat(comments);
26+
const newComments = [previousNode, ...comments];
2727

2828
return beforeNode(newComments, previousNode.prev(), node, previousNode.initialIndex);
2929
}
@@ -43,7 +43,7 @@ function afterNode(comments, nextNode, node, currentInitialIndex) {
4343
nextNode.position = node.position;
4444
nextNode.initialIndex = initialIndex + 0.0001;
4545

46-
return afterNode(comments.concat(nextNode), nextNode.next(), node, nextNode.initialIndex);
46+
return afterNode([...comments, nextNode], nextNode.next(), node, nextNode.initialIndex);
4747
}
4848

4949
// eslint-disable-next-line max-params
@@ -70,7 +70,7 @@ function beforeDeclaration(comments, previousNode, nodeData, currentInitialIndex
7070
// add a marker
7171
previousNode.sortProperty = true;
7272

73-
const newComments = [commentData].concat(comments);
73+
const newComments = [commentData, ...comments];
7474

7575
return beforeDeclaration(newComments, previousNode.prev(), nodeData, commentData.initialIndex);
7676
}
@@ -100,7 +100,7 @@ function afterDeclaration(comments, nextNode, nodeData, currentInitialIndex) {
100100
nextNode.sortProperty = true;
101101

102102
return afterDeclaration(
103-
comments.concat(commentData),
103+
[...comments, commentData],
104104
nextNode.next(),
105105
nodeData,
106106
commentData.initialIndex

lib/order/processLastComments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = function processLastComments(node, index, processedNodes) {
33
node.position = Infinity;
44
node.initialIndex = index;
55

6-
return processedNodes.concat(node);
6+
return [...processedNodes, node];
77
}
88

99
return processedNodes;

lib/order/processMostNodes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ module.exports = function processMostNodes(node, index, order, processedNodes) {
1818
// If comment on same line with the node and node, use node's indexes for comment
1919
const commentsAfter = getComments.afterNode([], node.next(), node);
2020

21-
return processedNodes.concat(commentsBefore, node, commentsAfter);
21+
return [...processedNodes, ...commentsBefore, node, ...commentsAfter];
2222
};

lib/properties-order/__tests__/vendor.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ let vendor = require('../vendor');
33
const VALUE = '-1px -1px 1px rgba(0, 0, 0, 0.2) inset';
44

55
it('returns prefix', () => {
6-
expect(vendor.prefix('-moz-color')).toEqual('-moz-');
7-
expect(vendor.prefix('color')).toEqual('');
8-
expect(vendor.prefix(VALUE)).toEqual('');
6+
expect(vendor.prefix('-moz-color')).toBe('-moz-');
7+
expect(vendor.prefix('color')).toBe('');
8+
expect(vendor.prefix(VALUE)).toBe('');
99
});
1010

1111
it('returns unprefixed version', () => {
12-
expect(vendor.unprefixed('-moz-color')).toEqual('color');
13-
expect(vendor.unprefixed('color')).toEqual('color');
12+
expect(vendor.unprefixed('-moz-color')).toBe('color');
13+
expect(vendor.unprefixed('color')).toBe('color');
1414
expect(vendor.unprefixed(VALUE)).toEqual(VALUE);
1515
});

lib/properties-order/sortNodeProperties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module.exports = function sortNodeProperties(node, { order, unspecifiedPropertie
5353
// If comment on same line with the node and node, use node's indexes for comment
5454
let commentsAfter = getComments.afterDeclaration([], childNode.next(), propData);
5555

56-
declarations = declarations.concat(commentsBefore, propData, commentsAfter);
56+
declarations = [...declarations, ...commentsBefore, propData, ...commentsAfter];
5757
}
5858
});
5959

0 commit comments

Comments
 (0)