From c09fa6cb57744f58a498607e326fb9f63746bbf9 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 21:10:53 +0000 Subject: [PATCH 1/2] Run tests in CI and configure unicorn/prefer-query-selector Add a `pnpm test` step to the pull request and push workflows. The test suite flagged unicorn/prefer-query-selector, which gained an `allowWithVariables` option in oxlint 1.88.0; set it to false (flag every getElementById/getElementsByClassName call). oxlint 1.83-1.87 reject any options on that rule, so raise the oxlint peer dependency floor to ^1.88.0. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TLBzrsN4hMwi77PvoAzqq8 --- .github/workflows/pr.yml | 2 ++ .github/workflows/push.yml | 2 ++ package.json | 2 +- src/oxlint/README.md | 6 ++++++ src/oxlint/rules/unicorn.ts | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7f0ea6b..6411090 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,6 +22,8 @@ jobs: with: cache: true require-lockfile: true + - name: Run Tests + run: pnpm test - name: Build Package run: pnpm build - name: Check Types diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6a34021..29fa11a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -16,6 +16,8 @@ jobs: with: cache: true require-lockfile: true + - name: Run Tests + run: pnpm test - name: Build Package run: pnpm build - name: Check Types diff --git a/package.json b/package.json index 107a9fb..aad2507 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ }, "peerDependencies": { "oxfmt": ">=0.73.0 <1", - "oxlint": "^1.83.0" + "oxlint": "^1.88.0" }, "peerDependenciesMeta": { "oxfmt": { diff --git a/src/oxlint/README.md b/src/oxlint/README.md index 9cd6bf4..48f0a67 100644 --- a/src/oxlint/README.md +++ b/src/oxlint/README.md @@ -2033,6 +2033,12 @@ These settings apply only to test files when `vitest` is set to `true` (default) #### [🛑 unicorn/prefer-query-selector](https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-query-selector) +##### Settings + +```json +{ "allowWithVariables": false } +``` + #### [🛑 unicorn/prefer-regexp-test](https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-regexp-test) #### [🛑 unicorn/prefer-single-call](https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-single-call) diff --git a/src/oxlint/rules/unicorn.ts b/src/oxlint/rules/unicorn.ts index c036d07..90a9c57 100644 --- a/src/oxlint/rules/unicorn.ts +++ b/src/oxlint/rules/unicorn.ts @@ -282,7 +282,7 @@ const unicorn: OxlintRuleGroup = { settings: "error", }, "unicorn/prefer-query-selector": { - settings: "error", + settings: ["error", { allowWithVariables: false }], }, "unicorn/prefer-regexp-test": { settings: "error", From fc884dd256f8e770b639991dbab6d62bb087ee88 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 21:13:29 +0000 Subject: [PATCH 2/2] Run tests after building the package in CI The rule tests shell out to `oxlint --rules`, which loads the repo's oxlint.config.ts and therefore needs the built dist/ output. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TLBzrsN4hMwi77PvoAzqq8 --- .github/workflows/pr.yml | 4 ++-- .github/workflows/push.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6411090..b82d4e3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,10 +22,10 @@ jobs: with: cache: true require-lockfile: true - - name: Run Tests - run: pnpm test - name: Build Package run: pnpm build + - name: Run Tests + run: pnpm test - name: Check Types run: pnpm typecheck - name: Build Docs diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 29fa11a..3ecf003 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -16,10 +16,10 @@ jobs: with: cache: true require-lockfile: true - - name: Run Tests - run: pnpm test - name: Build Package run: pnpm build + - name: Run Tests + run: pnpm test - name: Check Types run: pnpm typecheck - name: Build Docs