Show an error warning when a name occurs more than once in the names list of a destructured variable
- Dominant language
- JavaScript
- Stars
- 60
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
For example, put `a,b,a` in the name field, and `[1,2,3]` in the definition field.
When you run the question, an error "There is more than one definition of the variable a." is shown. The editor should show a warning, too. At the moment, it shows both values in the generated value box.
When there's only one variable name in the list, e.g. `a,a`, the editor does display an error "There's another variable or constant with the name a."
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with `a,b,a` as the name and `[1,2,3]` as the definition, then trace the editor's destructured-variable name validation and generated value box. Done means duplicate names show the same warning in the editor as when only `a,a` is entered, rather than displaying both values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100