Skip to content

Commit cf7844d

Browse files
authored
fix: upgrade and fix lint errors (Intellicode#304)
1 parent a66b303 commit cf7844d

12 files changed

+2417
-1708
lines changed

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pool:
1212
steps:
1313
- task: NodeTool@0
1414
inputs:
15-
versionSpec: '10.x'
15+
versionSpec: '16.x'
1616
displayName: 'Install Node.js'
1717

1818
- script: |

lib/rules/sort-styles.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function create(context) {
5353
const currentName = getStylePropertyIdentifier(current);
5454
const prevName = getStylePropertyIdentifier(prev);
5555
const hasComments = array
56-
.map((prop) => sourceCode.getComments(prop))
56+
.map((prop) => [...sourceCode.getCommentsBefore(prop), ...sourceCode.getCommentsAfter(prop)])
5757
.reduce(
58-
(hasComment, comment) => hasComment || comment.leading.length > 0 || comment.trailing > 0,
58+
(hasComment, comment) => hasComment || comment.length > 0,
5959
false
6060
);
6161

lib/util/stylesheet.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,12 @@ const astHelpers = {
198198
case 'Literal':
199199
return node.value;
200200
case 'TemplateLiteral':
201-
return node.quasis.reduce((result, quasi, index) => result
202-
+ quasi.value.cooked
203-
+ astHelpers.getExpressionIdentifier(node.expressions[index]),
204-
'');
201+
return node.quasis.reduce(
202+
(result, quasi, index) => result
203+
+ quasi.value.cooked
204+
+ astHelpers.getExpressionIdentifier(node.expressions[index]),
205+
''
206+
);
205207
default:
206208
return '';
207209
}

0 commit comments

Comments
 (0)