Vite+ 1.5.0 pins Oxlint 1.91.0 with effect-local immutability false positives

オープン 初心者向け
#3,360 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
71/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bun, react, rust, typescript, vite
領域
devtools, tooling

調査の方向性

Vite+のツールチェーンで固定されているOxlintのバージョンから始め、リリースバージョンがどのように選択されるかを確認してください。Vite+ 1.5.0を使って、提供された再現手順を vp lint --config .oxlintrc.json repro.tsx で実行し、その後、固定されているアナライザーと#28820にマージされたOxlintの修正を比較してください。Vite+のリリースに修正済みのアナライザーが含まれ、再現手順が誤検知なしで終了すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

triage: failed

Vite+ 1.5.0 pins Oxlint 1.91.0, which reports valid effect-local variable updates as react/immutability errors. This blocks consumers that keep the React correctness rules enabled when upgrading the Vite+ toolchain together.

The underlying regression is described in oxc-project/oxc#28401, closed by #28820. The fix is merged, but the current published Oxlint release is still 1.91.0 and the published Vite+ pin still reproduces it. This report tracks the consuming toolchain release; it does not request a separate implementation of the analyzer fix.

Reproduction

With [email protected] installed, create .oxlintrc.json:

{"categories":{"correctness":"off"},"plugins":["react"],"rules":{"react/immutability":"error"}}

Create repro.tsx:

import { useEffect, useState } from "react";
export function useElapsedSeconds(enabled: boolean) {
  const [seconds, setSeconds] = useState(0);
  useEffect(() => {
    if (!enabled) return;
    let previous = new Date();
    const poll = window.setInterval(() => {
      const next = new Date();
      setSeconds(value => value + (next.valueOf() - previous.valueOf()) / 1000);
      previous = next;
    }, 1000);
    return () => window.clearInterval(poll);
  }, [enabled]);
  return seconds;
}

Run vp lint --config .oxlintrc.json repro.tsx.

Actual: exit 1 at previous = next with react/immutability: Cannot reassign variable after render completes.

Expected: no diagnostic. previous is created inside each effect invocation and cannot mutate a render-scope binding. The same pattern affects effect-local cancellation flags and timer handles, so consumers would otherwise need unnecessary application rewrites or to weaken lint coverage.

Please include the released analyzer repair in a Vite+ release once available, keeping the toolchain pins coordinated. Verified on macOS arm64 with Bun 1.4.4; this example uses the Vite+ lint command and a minimal rule configuration.

主要言語
Rust
スター
6.5k
フォーク
297
平均マージ
1日 3時間
マージ済み PR(30日)
245

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/vite-plus のほかの issue

voidzero-dev/vite-plus の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。