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

Offen
#9,834 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
node.js, typescript
Bereich
backend, devtools

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
TypeScript
Sterne
3.2k
Forks
732
Ø Merge
3 T. 7 Std.
Gemergte PRs (30 T.)
117

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus googleapis/google-cloud-node

Alle Issues in googleapis/google-cloud-node

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.