-
-
Notifications
You must be signed in to change notification settings - Fork 272
fix(ui): reduce cls to 0 on package page #1304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+159
−155
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n app/pages/about.vue | head -50Repository: npmx-dev/npmx.dev
Length of output: 2162
🏁 Script executed:
rg "useLazyFetch" --type vue -A 3 -B 3Repository: npmx-dev/npmx.dev
Length of output: 88
🏁 Script executed:
rg "GitHubContributor\|Contributor.*type\|interface.*Contributor" --type ts --type tsx --type vue -A 3Repository: npmx-dev/npmx.dev
Length of output: 88
🌐 Web query:
Nuxt 3 useLazyFetch TypeScript generic type support💡 Result:
useLazyFetchdoes support TypeScript generics—it has the same generic signature asuseFetch. In the Nuxt docs the type is shown as:useLazyFetch<DataT, ErrorT>(..., options?: UseFetchOptions<DataT>) -> Promise<AsyncData<DataT, ErrorT>>. [1]Basic: type the response
(Generics are documented on
useFetch, anduseLazyFetchis explicitly “same signature”.) [1][2]Also type the error (optional)
(Generic
ErrorTis part of the documented signature.) [1][2]If you wrap it, preserve generics/overloads
If you create a custom wrapper composable, type it as
typeof useFetch/typeof useLazyFetch(or forward the full generic parameters), otherwise you often lose Nuxt’s built-in typing/inference. [3]Sources: Nuxt
useLazyFetchdocs (type signature) [1], NuxtuseFetchdocs (generic signature/details) [2], example of preserving types in a custom wrapper [3].🏁 Script executed:
rg "type.*Contributor|interface.*Contributor" --type ts --type vueRepository: npmx-dev/npmx.dev
Length of output: 88
🏁 Script executed:
rg "api/contributors" --type ts --type vue -B 2 -A 2Repository: npmx-dev/npmx.dev
Length of output: 88
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 149
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 1798
🏁 Script executed:
rg "type|interface" server/api/contributors.get.ts -A 5Repository: npmx-dev/npmx.dev
Length of output: 190
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 127
Add type-safe generic to
useLazyFetchcall.The call to
useLazyFetchlacks a generic type parameter, leavingcontributorsimplicitly typed, which violates the strict type-safety guideline. Import and use the existingGitHubContributortype from the API endpoint.♻️ Suggested fix
📝 Committable suggestion