Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint for perf issues with oxlint #366

Merged
merged 3 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Lint JS
run: npx --yes oxlint@latest
run: npx --yes oxlint@latest -D perf

test:
name: Unit tests
Expand Down
4 changes: 2 additions & 2 deletions src/values/destructure-font-shorthand.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function isSystemFont(node) {
* @param {*} stringifyNode
*/
export function destructure(value, stringifyNode) {
let font_family = new Array(2)
let font_family = Array.from({ length: 2 })
let font_size
let line_height

Expand Down Expand Up @@ -81,7 +81,7 @@ export function destructure(value, stringifyNode) {
) {
font_family[0] = node

if (!font_size && item.prev != null) {
if (!font_size && item.prev !== null) {
font_size = stringifyNode(item.prev.data)
}

Expand Down