PubSub class is reported as deprecated by TypeScript-based lint tooling

Đang mở
#9,834 0 bình luận 1 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
backend, devtools

Hướng nghiên cứu

Start by locating the @google-cloud/pubsub package declarations for the exported PubSub class and inspect the deprecation metadata TypeScript exposes. Reproduce with TypeScript 5.9.3 and the sonarjs/deprecation rule as described. Done when the class is no longer reported as deprecated unless it is intentionally deprecated and the issue is clarified with the supported replacement.

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

Mô tả

Description

When using @google-cloud/[email protected], the PubSub class is flagged as deprecated by lint rules that rely on TypeScript's deprecation diagnostics (specifically sonarjs/deprecation, rule S1874).

Every import and usage of PubSub produces a warning: 'PubSub' is deprecated.

We don't believe PubSub is actually intended to be deprecated — there's no replacement mentioned in the docs, and the class is used in all official examples. Is this a known issue?

Steps to Reproduce
  1. Create a TypeScript project with @google-cloud/[email protected]
  2. Use PubSub: import { PubSub } from '@google-cloud/pubsub'
  3. Run ESLint with the sonarjs/deprecation rule enabled
  4. Every import and usage of PubSub is flagged as deprecated
Environment
  • @google-cloud/pubsub: 6.3.2
  • TypeScript: 5.9.3
  • ESLint rule: sonarjs/deprecation (S1874)
  • Node.js: 24.22.2
Ngôn ngữ chính
TypeScript
Star
3.2k
Fork
732
Merge trung bình
3 ngày 7 giờ
Pull request đã merge (30 ngày)
117

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

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 googleapis/google-cloud-node

Tất cả issue của googleapis/google-cloud-node

Issue tương tự

Thêm issue về TypeScript

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.