Skip to content

Commit 37f0404

Browse files
committed
Refactor to toSorted method to return a copy of the array
We removed the TypeScript rule S4043 warning in the metric.ts file from the CSS analyzer.
1 parent 2e39e52 commit 37f0404

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/analysis/src/css/analysis/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ export function computeMetrics(root: Root | Document): CssMetrics {
8282
return {
8383
ncloc: Array.from(codeLines).sort((a, b) => a - b),
8484
commentLines: Array.from(commentCandidates).sort((a, b) => a - b),
85-
nosonarLines: nosonarLines.sort((a, b) => a - b),
85+
nosonarLines: nosonarLines.toSorted((a, b) => a - b),
8686
};
8787
}

0 commit comments

Comments
 (0)