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

False positive in require-yield where yield is anywhere but function scope #2323

Closed
maurice opened this issue Feb 5, 2024 · 1 comment · Fixed by #2326
Closed

False positive in require-yield where yield is anywhere but function scope #2323

maurice opened this issue Feb 5, 2024 · 1 comment · Fixed by #2326

Comments

@maurice
Copy link
Contributor

maurice commented Feb 5, 2024

Working

function* foo() { yield 0; }

Not working (simplified test case)

function* foo() { while (true) { yield 0; } }

False positive result

  ⚠ eslint(require-yield): This generator function does not have 'yield'
   ╭─[require_yield.tsx:1:11]
 1 │ function* foo() { while (true) { yield 0; } }
   ·           ───
   ╰────
@Boshen
Copy link
Member

Boshen commented Feb 5, 2024

This is regression from #2208, where @Dunqing removed the function stack from the semantic builder. I'll get it reverted and your test case 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants