Skip to content
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

[✨] Create a lint rule for sync$() #5596

Open
mhevery opened this issue Dec 15, 2023 · 3 comments
Open

[✨] Create a lint rule for sync$() #5596

mhevery opened this issue Dec 15, 2023 · 3 comments
Assignees
Labels
COMMUNITY: good first issue Good for newcomers COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it STATUS-1: needs triage New issue which needs to be triaged TYPE: enhancement New feature or request

Comments

@mhevery
Copy link
Contributor

mhevery commented Dec 15, 2023

Is your feature request related to a problem?

Qwik now has a new feature, sync$(), however, it comes with limitations. It would be great if there was a lint rule which could flag when the developer is using it improperly

Describe the solution you'd like

A lint rule qwik/sync$ which would flag whenever the function inside the sync$() would close over any variables (other than browser API) and flag it.

Describe alternatives you've considered

We will create a Rust check as well, but that one will not be instant, and can't provide that much detail.

Additional context

import {foo} from '...

<button onClick$(sync$(() => {
    foo(); // <= lint error. Can't close over 'foo'
  }))>
    click
  </button>
@mhevery mhevery added TYPE: enhancement New feature or request STATUS-1: needs triage New issue which needs to be triaged COMMUNITY: good first issue Good for newcomers COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it labels Dec 15, 2023
@Lemon2311
Copy link

Lemon2311 commented Dec 20, 2023

Hello, I`d like to fix this issue.

@gioboa
Copy link
Member

gioboa commented Dec 21, 2023

Thanks @Lemon2311 🎉 if you need an help don't hesitate to contact me 👍

@ahmaddonishyar
Copy link

hello, i am new to Open Source i'd like to work on this please assign me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMMUNITY: good first issue Good for newcomers COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it STATUS-1: needs triage New issue which needs to be triaged TYPE: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants