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

Aperta
#9,834 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
backend, devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
3.2k
Fork
732
Merge medio
3g 7h
PR unite (30g)
117

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleapis/google-cloud-node

Tutte le issue di googleapis/google-cloud-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.