Skip to content
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
21 changes: 18 additions & 3 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": ["@projectwallace/preset-oxlint"],
"extends": ["./node_modules/@projectwallace/preset-oxlint/index.json"],
"env": {
"node": true,
"browser": true
},
"rules": {},
"ignorePatterns": ["node_modules"]
"rules": {
"no-null": "off", // AST's need null
"jest/no-conditional-in-test": "off",
"vitest/no-conditional-in-test": "off",
"jest/no-conditional-expect": "off",
"vitest/no-conditional-expect": "off",
"max-depth": ["warn", { "max": 6 }]
},
"ignorePatterns": ["node_modules"],
"overrides": [
{
"files": ["benchmark/**/*.ts"],
"rules": {
"no-console": "off"
}
}
]
}
8 changes: 4 additions & 4 deletions benchmark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Bench } from 'tinybench'
import { parse, tokenize, walk } from '../dist/index.js'
import * as fs from 'node:fs'
import * as path from 'node:path'
// @ts-expect-error
// @ts-expect-error: no type definitions for css-tree
import * as csstree from 'css-tree'
import * as postcss from 'postcss'

Expand Down Expand Up @@ -63,7 +63,7 @@ bench
.add('Parse/walk - CSSTree - Bootstrap CSS', () => {
let ast = csstree.parse(bootstrapCSS, { positions: true })
let count = 0
// @ts-expect-error
// @ts-expect-error: no type definitions for css-tree
csstree.walk(ast, (node) => {
let type = node.type
let line = node.loc?.start.line
Expand Down Expand Up @@ -93,7 +93,7 @@ bench
.add('Parse/walk - CSSTree - Tailwind CSS', () => {
let ast = csstree.parse(tailwindCSS, { positions: true })
let count = 0
// @ts-expect-error
// @ts-expect-error: no type definitions for css-tree
csstree.walk(ast, (node) => {
let type = node.type
let line = node.loc?.start.line
Expand Down Expand Up @@ -140,7 +140,7 @@ console.table(
'File Size': getFileSize(name),
'ops/sec': stats?.throughput.mean.toFixed(0) ?? 'N/A',
'Average Time (ms)': stats?.latency.mean.toFixed(4) ?? 'N/A',
Margin: stats?.latency.rme != null ? `±${stats.latency.rme.toFixed(2)}%` : 'N/A',
Margin: stats?.latency.rme === null ? 'N/A' : `±${stats.latency.rme.toFixed(2)}%`,
}
}),
)
2 changes: 1 addition & 1 deletion benchmark/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { parse, walk } from '../dist/index.js'
import * as fs from 'node:fs'
import * as path from 'node:path'
// @ts-expect-error
// @ts-expect-error: no type definitions for css-tree
import * as csstree from 'css-tree'
import * as postcss from 'postcss'

Expand Down
Loading