Skip to content

Run tests in CI and configure unicorn/prefer-query-selector - #44

Merged
bachmacintosh merged 2 commits into
mainfrom
ci/run-tests
Oct 16, 2026
Merged

bachmacintosh merged 2 commits into
mainfrom
ci/run-tests

Conversation

@bachmacintosh

@bachmacintosh bachmacintosh commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • CI: adds a Run Tests (pnpm test) step to both pr.yml and push.yml, right after Build Package. It has to come after the build: the rule tests run oxlint --rules, which loads the repo's oxlint.config.ts, and that file imports the built dist/oxlint/index.mjs.
  • unicorn/prefer-query-selector: oxlint 1.88.0 added an allowWithVariables option to this rule, and the rule-settings test failed because we didn't set it. It's now set to ["error", { allowWithVariables: false }], so every getElementById()/getElementsByClassName() call is flagged, including ones that take a variable. The oxlint README was regenerated with pnpm build:docs.
  • oxlint peer range ^1.83.0 → ^1.88.0: oxlint 1.83 through 1.87 refuse to load a config that gives this rule any options ("This rule does not accept configuration options"), even false. I checked the schemas for 1.83.0 through 1.88.0 and ran 1.83.0 against the config. Consumers on those versions would get a config parse error, so the floor moves up.

That was the only failing test. Every other rule's settings already match oxlint 1.88.0's schema.

Testing

All of these passed locally, starting from a clean checkout with no dist/, in CI order: pnpm build, pnpm test (2718 tests), pnpm typecheck, pnpm build:docs (no other generated changes), pnpm format:check, pnpm lint.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TLBzrsN4hMwi77PvoAzqq8

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLBzrsN4hMwi77PvoAzqq8
@bachmacintosh
bachmacintosh marked this pull request as ready for review October 16, 2026 21:12
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLBzrsN4hMwi77PvoAzqq8
@bachmacintosh
bachmacintosh added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 79e969e Oct 16, 2026
1 check passed
@bachmacintosh
bachmacintosh deleted the ci/run-tests branch October 16, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants