JavaScript rule useless-assign
reports false positive with require and object destructuring
#2862
Open
1 of 3 tasks
Labels
useless-assign
reports false positive with require and object destructuring
#2862
Update: the bug is now tracked at semgrep/semgrep#7531
Describe the bug
JavaScript rule useless-assign reports a false positive for sequential statements with object destructuring and at least one with a
require
statement, specifically an error with assigning a value toconst
twice. I'm reporting it here because it was found with one specific rule, but it does appear to be a parsing error rather than a rule error.The following cases all report the warnings indicated:
The following cases report no warning:
To Reproduce
See example here or above.
Expected behavior
No warnings should be reported.
Priority
How important is this to you?
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: