Skip to content

feat: enable oxlint suspicious category, fix 24 violations#22727

Merged
kitlangton merged 1 commit intodevfrom
kit/oxlint-suspicious
Apr 16, 2026
Merged

feat: enable oxlint suspicious category, fix 24 violations#22727
kitlangton merged 1 commit intodevfrom
kit/oxlint-suspicious

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

Enable the oxlint suspicious rule category (53 rules) to catch code that is likely wrong or useless. Suppress 8 rules that are too noisy for this codebase, fix all violations from the remaining rules.

Rules suppressed (too noisy)

Rule Count Reason
no-shadow 606 Effect's nested function* closures inherently shadow
consistent-function-scoping 124 Namespace-heavy codebase
no-array-sort / no-array-reverse 123 Mutation is fine here
prefer-add-event-listener 23 Not a DOM event handler codebase
require-module-specifiers 3 Bundler handles resolution
require-post-message-target-origin 5 Not relevant
no-new 7 Side-effectful constructors are intentional

Fixes applied

Rule Fix
no-unneeded-ternary info.reload ? true : truetrue (likely bug — always true regardless)
preserve-caught-error (7) Added { cause: error } to re-thrown errors that lost the original stack trace
no-useless-concat (8) Merged adjacent string literal concatenations
no-instanceof-builtins (1) instanceof Functiontypeof === "function"
no-useless-constructor (4) Inline suppress — DurableObject ctor + test mocks
no-extraneous-class (2) Inline suppress — test stub classes
no-unmodified-loop-condition (1) Inline suppress — variable set by external stop() call

Enable the suspicious rule category (53 rules) with 8 noisy rules
suppressed. Fix all violations from the remaining rules:

- Fix likely bug: `info.reload ? true : true` (always true)
- Add `{ cause }` to 7 re-thrown errors that lost the original stack
- Merge 8 useless string concatenations
- Replace `instanceof Function` with `typeof === 'function'`
- Suppress 7 intentional patterns (test mocks, Durable Object ctor)
@kitlangton kitlangton enabled auto-merge (squash) April 16, 2026 02:46
@kitlangton kitlangton merged commit 702f741 into dev Apr 16, 2026
13 checks passed
@kitlangton kitlangton deleted the kit/oxlint-suspicious branch April 16, 2026 02:53
jerome-benoit pushed a commit to jerome-benoit/opencode that referenced this pull request Apr 16, 2026
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant