Skip to content

Commit b3d4a88

Browse files
committed
fix: resolve pre-existing lint errors (unicorn/prefer-single-call, prefer-number-coercion)
Unrelated to the regex-hoisting change, but blocking CI on this PR.
1 parent 5e4c4c2 commit b3d4a88

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/lib/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ function print_list(nodes: CSSNode[], optional_space = SPACE): string {
123123
for (let node of nodes) {
124124
if (is_function(node)) {
125125
let fn = node.name.toLowerCase()
126-
parts.push(fn, OPEN_PARENTHESES)
127-
parts.push(print_list(node.children, optional_space))
128-
parts.push(CLOSE_PARENTHESES)
126+
parts.push(fn, OPEN_PARENTHESES, print_list(node.children, optional_space), CLOSE_PARENTHESES)
129127
} else if (is_dimension(node)) {
130128
parts.push(node.value, node.unit?.toLowerCase())
131129
} else if (is_string(node)) {
@@ -198,8 +196,8 @@ function print_nth(node: NthSelector, optional_space = SPACE): string {
198196
result += optional_space
199197
if (!b.startsWith('-')) result += '+' + optional_space
200198
}
201-
// the parseFloat removes the leading '+', if present
202-
result += parseFloat(b)
199+
// Number() removes the leading '+', if present
200+
result += Number(b)
203201
}
204202
return result
205203
}

0 commit comments

Comments
 (0)