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
no-empty-function false positive #12768
Comments
I can see in the source code that there is actually some code for handling async methods and functions. But it's basically dead code now. I guess one of the possible solutions would be to extend the ALLOW_OPTIONS array to include "asyncFunctions" and "asyncMethods". That way it would be an enhancement, I guess. |
Verified using our demo. Given that we have a separate option for I'm not sure whether to mark this as a bug or an enhancement, since adding new options is an enhancement, but given the lack of these options, I think this should also be classified as a bug. 🤷♂ Either way, I support solving this by adding |
I also think this should be fixed in some way. There are also async arrow functions. By the current implementation, it seems that async generator functions and async generator methods would be treated as just generator functions/generator methods? Looks like there could be an exponential growth of options if something new appears. |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
On thinking about this more, this seems like a clear case of an unintentionally missing feature (it was probably implemented before async functions were added to the language). The rule definitely doesn't feel complete without it, so I'm marking as accepted. If anyone from the team disagrees, please let me know! |
…13036) * Fix: added async in allow method in no-empty-function * Chore: added tests for async* allow * Docs: updated docs for async method and funct * Chore: more tests and test fixes and docs refactore * Update docs/rules/no-empty-function.md Co-Authored-By: YeonJuan <yeonjuan93@naver.com> * Update docs/rules/no-empty-function.md Co-Authored-By: YeonJuan <yeonjuan93@naver.com> * Update docs/rules/no-empty-function.md Co-Authored-By: YeonJuan <yeonjuan93@naver.com> * Docs: fixed the ecma version for docs snippet Co-authored-by: YeonJuan <yeonjuan93@naver.com>
…2768) (eslint#13036) * Fix: added async in allow method in no-empty-function * Chore: added tests for async* allow * Docs: updated docs for async method and funct * Chore: more tests and test fixes and docs refactore * Update docs/rules/no-empty-function.md Co-Authored-By: YeonJuan <yeonjuan93@naver.com> * Update docs/rules/no-empty-function.md Co-Authored-By: YeonJuan <yeonjuan93@naver.com> * Update docs/rules/no-empty-function.md Co-Authored-By: YeonJuan <yeonjuan93@naver.com> * Docs: fixed the ecma version for docs snippet Co-authored-by: YeonJuan <yeonjuan93@naver.com>
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
eslint .
What did you expect to happen?
No
no-empty-function
warnings.What actually happened? Please include the actual, raw output from ESLint.
Are you willing to submit a pull request to fix this bug?
Yes
The text was updated successfully, but these errors were encountered: