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
Rule Change: make no-return-await suggestable #16632
Comments
Hi @dbartholomae This proposal has been made in the past (#7593). |
I agree with @yeonjuan, per #7593 (comment) this doesn't seem safe for autofixing. Perhaps we could consider implementing this as suggestions? |
Thanks, I didn't find that issue when searching. |
Happy to close this, unless it makes sense to discuss implementing this as a suggestion here |
I'd be fine with implementing a suggestion. Just so everyone is aware: suggestions have no effect on the command line, they are just displayed inside of editors like Visual Studio Code as potential fixes. If that's what you're interested in, then we can move forward. |
Is it possible to auto-fix suggestions via |
If there is interest in some way to auto-fix suggestions, that would also be something that I would be willing to contribute - or set up as a separate open-source repo that uses eslint machine-readable output. |
No, there is no way to autofix suggestions. The And no, we don't want to auto-fix suggestions in the core. As already explained, autofixes must not change the meaning of the code being fixed as otherwise there can be side effects that are difficult to identify. |
Thanks! I haven't tried it yet, but it seems that eslint-interactive already allows to auto-fix suggestions. I'll check it, and if it works, I would love to contribute a suggestion for this rule :) |
Looks good! If you are interested, I'm happy to provide a PR on this. Thanks for all the support and the patience with my questions! |
Yes, PR is welcome! |
I've opened #16637 to fix this. |
What rule do you want to change?
no-return-await
What change to do you want to make?
Implement autofix
How do you think the change should be implemented?
A new option
Example code
What does the rule currently do for this code?
// Error, but don't change:
async function foo {
return await Promise.resolve("bar")
}
What will the rule do after it's changed?
// Fix it
async function foo {
return Promise.resolve("bar")
}
Participation
Additional comments
Hi! There have been discussions about whether
no-return-await
should be a core rule. These are resolved - and, consequently, I would argue that the rule should be auto-fixable.The text was updated successfully, but these errors were encountered: