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
53 changes: 3 additions & 50 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,9 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"import",
"typescript",
"oxc",
"unicorn"
],
"extends": ["@projectwallace/preset-oxlint"],
"env": {
"node": true,
"browser": true,
"es2024": true
"browser": true
},
"categories": {
"perf": "error",
"correctness": "error",
"pedantic": "error"
},
"rules": {
"unicorn/no-null": "error",
"unicorn/prefer-set-has": "off",
"prefer-string-slice": "off",
"prefer-code-point": "off",
"no-lonely-if": "off",
"no-unused-vars": "off",
"no-await-in-loop": "off",
"prefer-query-selector": "off",
"max-dependencies": "off",
"ban-types": "off",
"no-undefined": "off",
"no-useless-undefined": "off",
"max-classes-per-file": "off",
"max-lines-per-function": "off",
"prefer-math-trunc": "off",
"max-lines": "off",
"max-depth": [
"warn",
{
"max": 5
}
],
"explicit-function-return-type": "off",
"no-console": "off",
"no-optional-chaining": "off",
"no-commonjs": "off",
"unambiguous": "off",
"no-default-export": "off",
"no-async-await": "off",
"no-non-null-assertion": "off",
"no-plusplus": "off",
"no-bitwise": "off",
"default-case": "off",
"no-rest-spread-properties": "off",
"require-await": "warn"
}
"rules": {}
}
1 change: 1 addition & 0 deletions knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { KnipConfig } from 'knip'
const config: KnipConfig = {
entry: ['src/lib/index.ts', 'src/cli/cli.ts'],
project: ['src/**/*.ts'],
ignoreDependencies: ['@projectwallace/preset-oxlint'],
}

export default config
12 changes: 12 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"devDependencies": {
"@codecov/vite-plugin": "^1.9.1",
"@playwright/test": "^1.56.0",
"@projectwallace/preset-oxlint": "^0.0.6",
"@types/node": "^24.9.2",
"c8": "^10.1.3",
"knip": "^5.66.4",
Expand Down
4 changes: 1 addition & 3 deletions src/cli/reporters/pretty.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { test, expect } from '@playwright/test'
import { print_lines as print, PrintLinesDependencies, type StyleTextFn, TextStyle } from './pretty'
import { print_lines as print, PrintLinesDependencies, TextStyle } from './pretty'
import { Report } from '../program'
import { CoverageResult } from '../../lib'
import { CliArguments } from '../arguments'
import { PrettifiedChunk } from '../../lib/prettify'

// test matrix
// ------------------------------
Expand Down Expand Up @@ -59,7 +58,6 @@ const min_file_line_coverage_failure = {
}

const show_none = { 'show-uncovered': 'none' } as CliArguments
const show_all = { 'show-uncovered': 'all' } as CliArguments
const show_violations = { 'show-uncovered': 'violations' } as CliArguments

const context_empty = {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/reporters/pretty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function percentage(ratio: number, decimals: number = 2): string {

export type TextStyle = 'bold' | 'red' | 'dim' | 'green'

export type StyleTextFn = (style: TextStyle | TextStyle[], input: string) => string
type StyleTextFn = (style: TextStyle | TextStyle[], input: string) => string

export type PrintLinesDependencies = {
styleText: StyleTextFn
Expand Down
2 changes: 1 addition & 1 deletion src/cli/reporters/tap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function meta(data: Record<string | number, string | number>) {
console.log(' ...')
}

export function print({ report, context }: Report, params: CliArguments): void {
export function print({ report, context }: Report, _params: CliArguments): void {
let total_files = context.coverage.coverage_per_stylesheet.length
let total_checks = total_files + 1
let checks_added = 1
Expand Down
2 changes: 1 addition & 1 deletion src/lib/html-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class DOMParser {
pos = close + '</style>'.length
}
return {
querySelectorAll(selector: 'style') {
querySelectorAll(_selector: 'style') {
return styles
},
}
Expand Down
3 changes: 1 addition & 2 deletions src/lib/prettify.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { test, expect } from '@playwright/test'
import { prettify } from './prettify'
import { test } from '@playwright/test'

test.skip('simple range at start', () => {})
test.skip('simple range at middle', () => {})
Expand Down
2 changes: 1 addition & 1 deletion src/lib/test/kitchen-sink.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test'
import { calculate_coverage, parse_coverage, type Coverage, type CoverageResult } from '../index.js'
import { calculate_coverage, parse_coverage, type Coverage } from '../index.js'
import { generate_coverage } from './generate-coverage.js'
import { format } from '@projectwallace/format-css'
import * as fs from 'node:fs/promises'
Expand Down