Skip to content

Comments

fix: use await now warn function with decorator even if it has a call…#5485

Merged
ematipico merged 6 commits intobiomejs:mainfrom
Xstoudi:fix/use-await-decorator-callback
Mar 31, 2025
Merged

fix: use await now warn function with decorator even if it has a call…#5485
ematipico merged 6 commits intobiomejs:mainfrom
Xstoudi:fix/use-await-decorator-callback

Conversation

@Xstoudi
Copy link
Contributor

@Xstoudi Xstoudi commented Mar 27, 2025

…back

Fixes: #4993

Summary

As mentionned in git commit message, this PR aims to fix #4993.
useAwait rule was not properly warning if decorator contained a callback.

Let me know if you need more precision or if I made a mistake: first contribution here so I could have made one.

Test Plan

I added relevant test in the related invalid.js and ensured no previous test break.

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 27, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 27, 2025

CodSpeed Performance Report

Merging #5485 will not alter performance

Comparing Xstoudi:fix/use-await-decorator-callback (39359de) with main (60a3d02)

Summary

✅ 95 untouched benchmarks

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is failing because of outdated snapshots. Are they regressions?

@Xstoudi
Copy link
Contributor Author

Xstoudi commented Mar 28, 2025

I'm trying to understand why there is polluting whitespace in my snap, consider the PR as WIP for now :/

@ematipico ematipico merged commit 5572e4c into biomejs:main Mar 31, 2025
12 checks passed
@Xstoudi Xstoudi deleted the fix/use-await-decorator-callback branch March 31, 2025 21:54
@Xstoudi
Copy link
Contributor Author

Xstoudi commented Mar 31, 2025

Thanks @ematipico!

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

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 useAsync does not warn on functions with decorator with callback argument

2 participants