Skip to content

Commit

Permalink
Lint code using oxlint (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartveneman authored Dec 26, 2023
1 parent d937b4b commit 41ad5dc
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ on:
branches: [master]

jobs:
lint:
name: Lint JS
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Lint JS
run: npx --yes oxlint@latest

test:
name: Unit tests
runs-on: ubuntu-latest
Expand Down
158 changes: 158 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"scripts": {
"test": "uvu",
"lint": "oxlint",
"build": "microbundle"
},
"keywords": [
Expand All @@ -52,6 +53,7 @@
},
"devDependencies": {
"microbundle": "^0.15.1",
"oxlint": "^0.0.22",
"uvu": "^0.5.6"
},
"mangle": {
Expand Down
1 change: 0 additions & 1 deletion src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ Api('handles empty input gracefully', () => {
"total": 0,
"totalUnique": 0,
"unique": {},
"total": 0,
"uniquenessRatio": 0,
"items": []
},
Expand Down
1 change: 0 additions & 1 deletion src/rules/rules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Rules('should handle CSS without rules', () => {
range: 0,
sum: 0,
items: [],
items: [],
unique: {},
total: 0,
totalUnique: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/selectors/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function getComplexity(selector) {
}

if (node.type === AttributeSelector) {
if (Boolean(node.value)) {
if (node.value) {
complexity++
}
if (hasVendorPrefix(node.name.name)) {
Expand Down

0 comments on commit 41ad5dc

Please sign in to comment.