ESLint Plugin: no-unused-vars-before-return: Exempt destructuring only if to multiple properties #16799
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #15578 (comment)
This pull request seeks to apply additional restrictions in the
no-unused-vars-before-return
rule to treat an object destructuring of a single property as being non-exempt from consideration for the rule. This exemption exists only due to complexity in verifying that all properties of the destructuring are referenced prior to the return statement. In the case of destructuring a single property, there is no such complexity.There was a single violation of this improvement already present in the code, fixed in 44a4ac9.
Testing Instructions:
Verify there are no lint errors:
Ensure unit tests pass: