DavidWells / DavidWells/analytics
TypeScript support for @analytics/google-tag-manager
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
I am using @analytics/google-tag-manager.
I saw analytics have TypeScript support while @analytics/google-tag-manager not.
When add
import googleTagManager from '@analytics/google-tag-manager';
got
TS7016: Could not find a declaration file for module '@analytics/google-tag-manager'. '/hongbomiao.com/client/node_modules/@analytics/google-tag-manager/lib/analytics-plugin-google-tag-manager.cjs.js' implicitly has an 'any' type. Try
npm install @types/analytics__google-tag-managerif it exists or add a new declaration (.d.ts) file containingdeclare module '@analytics/google-tag-manager';
It would be great to add TypeScript in future. Thanks! : )
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the @analytics/google-tag-manager package and its lib/analytics-plugin-google-tag-manager.cjs.js entry point. Check how the package is exported and what TypeScript users need to import. Done means the shown import no longer produces TS7016 and the package's exposed API has usable declarations; no test file is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100