OWASP / OWASP/Nest

Introduce ESLint rule to discourage unsafe as assertions with useParams()

Open
#3,539 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
451
Forks
702
Avg merge
22h 59m
Merged PRs (30d)
91

Description

**Is your feature request related to a problem? Please describe.**

In the frontend codebase, route parameters obtained from `useParams()` are sometimes forcefully type-asserted using `as`, for example:

```ts
const { programKey, moduleKey } = useParams() as {
programKey: string
moduleKey: string
}

```
**Are you going to work on implementing this?**

- [x] Yes
- [ ] No

Reference #2701

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.