Repository navigation
fix(lint/no-meaningless-void-operator): report void on non-call expressions - #1071
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codex Review Summary: β CompletedThis comment shows the latest Codex review activity on this pull request.
βΉοΈ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with π while any review is running, comments if it has suggestions, and reacts with π once all reviews finish with no findings. |
Merging this PR will degrade performance by 3.6%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Performance change vs mainWorkflow run Β· main Clef gate: Running benchmarks because the decision was unavailable (crates/tsrs_lint/src/rules/no_meaningless_void_operator.rs: patch exceeds the Clef context limit (6535 bytes)). Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time. Measured medians (main β PR)
tsrs-lintRelease
Negative means the PR used less. Wall and CPU time deltas are medians of paired PR/main ratios; peak RSS compares medians. Measured lint medians (main β PR)
|
These versions complete the toolchain set in Effect's 0.74.1 support table. tsrs5 changes two type-aware rules: - `no-meaningless-void-operator` now rejects `void` on anything but a call (oxc-project/tsrs#1071). That flagged the `void x;` markers our type tests used to keep compile-time-only values "used". - `no-unsafe-class-instance-assignment` is new (oxc-project/tsrs#1059). It rejects object literals cast to Convex validator classes and the `IndexRange` recording fixture. Rewrite each marker in a form every rule accepts, without weakening the check. Dropping `void` leaves bare expressions that `no-unused-expressions` rejects. Bare QueryStream calls trip `floating-effect`. `_`-prefixed bindings fail `noUnusedLocals`, and on `@ts-expect-error` lines that unused-local error would satisfy the directive by itself. - A binding that existed only to hold an erroring call becomes `void call()`, with the directive still on the same line. - `@ts-expect-error` property accesses become `expectTypeOf(β¦).not.toHaveProperty(β¦)`. - Annotated assignability bindings become `toExtend`. - The constructor check asserts `toBeInstanceOf`, and forced getters assert `toBeDefined`. - Benchmark baseline expressions move into attest's `bench.baseline`. Breaking each new type assertion fails typecheck, so they still enforce their conditions. Class-typed benchmark values and the fixture now cast through `unknown`. That removes the `{}`-to-class comparison from the 32 `SchemaToValidator` type benchmarks, so their instantiation baselines are re-recorded. Core baselines and the other server suites are unchanged. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Ports oxc-project/tsgolint#1375, which follows typescript-eslint/typescript-eslint#12727.
no-meaningless-void-operatornow reportsmeaninglessVoidOnNonCallwhenvoidis applied to something other than a call:This was previously accepted. Standalone expression statements get an autofix that removes
void; assignments,void 0and thenables remain allowed.voidremoval fixes now keep the statement's syntax. Operands such as object literals and function expressions are wrapped, and a semicolon is inserted when ASI would join the result to the previous statement.The rule baseline is refreshed from tsgolint
bcdea900withtools/tsgolint/export.mts --reference bcdea9002b3b5655d90e84b8fdb89d43305fabed. Unchanged cases keep their existing JSON layout to avoid churn from Go map-key ordering. A headless build of the same tsgolint commit also matches tsrs across all eightcheckNeverand fix-flag combinations for extra template, regex, decorator,async function, block and switch-clause removals.