Skip to content

feat(oxlint-config): widen the library rule set and fix test override globs - #265

Merged
jan-kubica merged 1 commit into
mainfrom
chore/oxlint-rule-audit
Nov 7, 2026
Merged

jan-kubica merged 1 commit into
mainfrom
chore/oxlint-rule-audit

Conversation

@jan-kubica

Copy link
Copy Markdown
Contributor

Audit of the library() rule set against the oxlint 1.89 catalog.

Missing rules, now on. oxlint enables only the correctness category by default, so several bug-shaped rules were never active: eqeqeq (== null allowed), no-var, prefer-const, ban-ts-comment, preserve-caught-error, no-deprecated, no-implied-eval/no-new-func, import/no-duplicates, the type-aware no-unnecessary-* trio, prefer-promise-reject-errors (to match only-throw-error), and others listed in the changeset. React files selected with react.files now also get the React correctness rules. exhaustive-deps and jsx-no-undef stay off because the compiler rules and TypeScript already cover them.

Override bug. The test override used __tests__/** and __test__/**. Override globs are anchored at the config directory, so test folders inside packages never matched, and neither did .mts/.cts/.mjs/.cjs test files. The new library-overrides.test.ts covers this.

Dead config. The repo's own override turned off five no-unsafe-* rules that the preset never enables. The off entries in libraryRules are inactive inside library(), but consumers spread libraryRules over broader presets, so they stay, now with a comment saying why.

Considered, left out:

  • no-fallthrough: already covered by noFallthroughCasesInSwitch in the shared tsconfig, and oxlint misreads commented empty cases.
  • unicorn/throw-new-error: flags class X extends TaggedError(...).
  • no-template-curly-in-string: noisy on workflow ${{ }} strings.
  • no-await-in-loop, unicorn/no-array-sort, no-param-reassign, strict-void-return: too noisy.
  • The no-unsafe-* family: about 630 hits in this repo alone, so it needs a separate ratchet.
  • prefer-optional-chain: still in the nursery category.

The new rules' findings in this repo are fixed. The two intentional ones carry a disable comment with a reason. This is a major bump because consumer lint can fail on upgrade.

@jan-kubica
jan-kubica enabled auto-merge November 7, 2026 20:35
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request expands @stll/oxlint-config rules and test-file matching. It also preserves causes in selected errors and updates build checks, lint overrides, and test fixtures.

Changes: Lint rules and matching

Layer / File(s) Summary
Rule sets, test matching, and coverage
.changeset/library-rule-audit.md, packages/oxlint-config/src/index.ts, packages/oxlint-config/src/library-overrides.test.ts
The library rule set gains rules across several categories. React correctness rules change to errors, with react/exhaustive-deps and react/jsx-no-undef remaining off. Test-file matching expands to nested directories and additional extensions. The test checks that only the expected source file reports a non-null assertion.
Lint configuration and source adjustments
oxlint.config.ts, packages/oxlint-config/src/typecheck-probe.ts, packages/oxlint-config/src/plugin.ts, packages/oxlint-plugin/src/*, packages/test-kit/src/rejection.test.ts
Plugin-source overrides stop disabling five unsafe-operation rules. Fixture overrides disable four additional rules. Source comments, imports, AST-node checks, and a route-helper computed-property check are also updated.

Error-cause preservation

Layer / File(s) Summary
Cloud setup error context
packages/oxlint-config/src/cloud-setup-claude.ts, packages/oxlint-config/src/cloud-setup-cli.ts, packages/oxlint-config/src/cloud-setup-toolchains.ts
Cloud settings parse and read errors now preserve their underlying cause. The parseCloudSetup type import joins the existing grouped import.
Packed JavaScript error context
packages/oxlint-config/src/publish-artifact-syntax.ts, packages/oxlint-config/src/publish-artifact-archive.test.ts
Two packed-JavaScript error wrappers now preserve the caught error as their cause. The archive test checks the packed member path with includes.

Build and tooling adjustments

Layer / File(s) Summary
Build and selector checks
packages/oxlint-config/src/publish-build-target-vite-dts-helper.ts, packages/oxlint-config/src/toolchain-changed.ts
The Vite declaration helper rejects any falsy config.build.write value. The .npmrc selector check uses String.includes to check for the same literal.
Command fixture updates
packages/oxlint-config/src/toolchain-rust.test.ts, packages/oxlint-config/src/toolchain-workflow-trust.test.ts
The test fixtures use simpler expressions to produce the existing Docker, Node, and Python command strings.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Possibly related PRs

  • stella/tooling#234: Updates the oxlint and oxlint-tsgolint versions that provide the rule catalog and tsgolint baseline used by this rule-set change.
Merge Risk: Minimal · up to 91ac3

The stricter lint defaults are documented as a major release. No concrete blocking regression is established; the override test could optionally verify that every fixture is scanned.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jan-kubica
jan-kubica added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit c655522 Nov 7, 2026
12 of 13 checks passed
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.

1 participant