Enhancement: [no-confusing-void-expression] ignoreVoidReturningFunctions should suggest adding void annotation #10290
Labels
enhancement: plugin rule option
New rule option for an existing eslint-plugin rule
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Proposal Please Confirm You Have Done The Following...
My proposal is suitable for this project
Link to the rule's documentation
https://deploy-preview-10067--typescript-eslint.netlify.app/rules/no-confusing-void-expression#ignorevoidreturningfunctions
Description
When given code:
The error says to move the
console.log
beforereturn
and autofix does it automatically, but whenignoreVoidReturningFunctions
is enabled a simpler fix would be to simply add the void annotation to the function return type.I think it should mention this possibility in every error message and autofix should do whatever requires less changes. For example for arrow functions it could preserve the current behavior and fix by adding braces.
Fail
// no changes
Pass
// no changes
Additional Info
Continued from #8538
The text was updated successfully, but these errors were encountered: