`$page.params` typed?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
Hi great people!
Sometimes it happens I forget to change code I copy from other files and I do not get errors if the params are wrong:
Example in src/routes/players/[player_id]/+page.svelte, this is wrong:
playerId={$page.params.team_id}
it should be:
playerId={$page.params.player_id}
Is there a way to make the compiler shout that that param is wrong in that place?
Describe the proposed solution
I don't really know.
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
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 with src/routes/players/[player_id]/+page.svelte and inspect how $page.params is typed there. The change is done when the compiler rejects team_id in this route while accepting player_id, with the behavior covered by an appropriate test or example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100