Skip to content

feat(eslint-plugin-qwik): add no-await-navigate-in-use-task rule#8549

Open
VedantMadane wants to merge 1 commit intoQwikDev:mainfrom
VedantMadane:feat/eslint-no-await-navigate-in-use-task-6993
Open

feat(eslint-plugin-qwik): add no-await-navigate-in-use-task rule#8549
VedantMadane wants to merge 1 commit intoQwikDev:mainfrom
VedantMadane:feat/eslint-no-await-navigate-in-use-task-6993

Conversation

@VedantMadane
Copy link
Copy Markdown

@VedantMadane VedantMadane commented Apr 12, 2026

Summary

Adds ESLint rule qwik/no-await-navigate-in-use-task to flag await on the function returned by useNavigate() inside a blocking useTask$ (no { deferUpdates: false } option), matching the resolution criteria in #6993.

Implementation

  • Tracks identifiers bound from useNavigate() across enclosing component$ scopes (and module scope for tests).
  • Skips reporting when useTask$ is called with a second argument object that sets deferUpdates: false.
  • Adds unit tests under packages/eslint-plugin-qwik/tests/no-await-navigate-in-use-task/.
  • Adds a patch changeset for 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

Detect awaiting useNavigate() inside blocking useTask$ without deferUpdates: false.

Fixes QwikDev#6993
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 12, 2026

🦋 Changeset detected

Latest commit: c6e0db7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
eslint-plugin-qwik Patch
@builder.io/qwik Patch
@builder.io/qwik-city Patch
create-qwik Patch
@builder.io/qwik-react Patch

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

@VedantMadane VedantMadane requested a review from a team as a code owner April 12, 2026 12:08
@Varixo
Copy link
Copy Markdown
Member

Varixo commented Apr 12, 2026

Thanks for the PR, but this should be done against build/v2 branch. Can you change that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐞] eslint rule: do not await nav() inside blocking useTask$

2 participants