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

Đang mở Phù hợp với người mới
#3,360 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
71/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, react, rust, typescript, vite
Lĩnh vực
devtools, tooling

Hướng nghiên cứu

Bắt đầu với phiên bản Oxlint được ghim trong toolchain của Vite+ và kiểm tra cách phiên bản phát hành được chọn. Chạy ví dụ tái hiện được cung cấp bằng vp lint --config .oxlintrc.json repro.tsx với Vite+ 1.5.0, sau đó so sánh analyzer được ghim với bản sửa lỗi Oxlint đã được hợp nhất trong #28820. Hoàn tất khi một bản phát hành Vite+ có analyzer đã sửa và ví dụ tái hiện kết thúc mà không có false positive.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
6.5k
Fork
297
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
245

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của voidzero-dev/vite-plus

Tất cả issue của voidzero-dev/vite-plus

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.