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

Open
#9,834 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js, typescript
Domain
backend, devtools

Research direction

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.

Written by the indexing model from the issue text.

Description

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
Dominant language
TypeScript
Stars
3.2k
Forks
732
Avg merge
3d 7h
Merged PRs (30d)
117

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-node

All issues in googleapis/google-cloud-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.