Skip to content

Commit 3b16418

Browse files
authored
lint for perf issues with oxlint (#366)
1 parent 41ad5dc commit 3b16418

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Checkout code
1818
uses: actions/checkout@v3
1919
- name: Lint JS
20-
run: npx --yes oxlint@latest
20+
run: npx --yes oxlint@latest -D perf
2121

2222
test:
2323
name: Unit tests

src/values/destructure-font-shorthand.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function isSystemFont(node) {
4747
* @param {*} stringifyNode
4848
*/
4949
export function destructure(value, stringifyNode) {
50-
let font_family = new Array(2)
50+
let font_family = Array.from({ length: 2 })
5151
let font_size
5252
let line_height
5353

@@ -81,7 +81,7 @@ export function destructure(value, stringifyNode) {
8181
) {
8282
font_family[0] = node
8383

84-
if (!font_size && item.prev != null) {
84+
if (!font_size && item.prev !== null) {
8585
font_size = stringifyNode(item.prev.data)
8686
}
8787

0 commit comments

Comments
 (0)