feat(eslint-plugin-qwik): add no-await-navigate-in-use-task rule#8549
Open
VedantMadane wants to merge 1 commit intoQwikDev:mainfrom
Open
feat(eslint-plugin-qwik): add no-await-navigate-in-use-task rule#8549VedantMadane wants to merge 1 commit intoQwikDev:mainfrom
VedantMadane wants to merge 1 commit intoQwikDev:mainfrom
Conversation
Detect awaiting useNavigate() inside blocking useTask$ without deferUpdates: false. Fixes QwikDev#6993
🦋 Changeset detectedLatest commit: c6e0db7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
|
Thanks for the PR, but this should be done against build/v2 branch. Can you change that? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds ESLint rule
qwik/no-await-navigate-in-use-taskto flagawaiton the function returned byuseNavigate()inside a blockinguseTask$(no{ deferUpdates: false }option), matching the resolution criteria in #6993.Implementation
useNavigate()across enclosingcomponent$scopes (and module scope for tests).useTask$is called with a second argument object that setsdeferUpdates: false.packages/eslint-plugin-qwik/tests/no-await-navigate-in-use-task/.eslint-plugin-qwik.Relation to #7896
PR #7896 tried to address the same issue with starter routes and E2E coverage; it was closed without merge and CI reported failing E2E on ubuntu chromium. This PR follows the issue direction from maintainers (ESLint rule) and avoids fragile E2E navigation timing.
Fixes #6993