exercism / exercism/javascript-analyzer

Improve two-fer: recognise re-assignment

Offen
#52 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
16
Forks
21
Ø Merge
6 Std. 53 Min.
Gemergte PRs (30 T.)
2

Beschreibung

**Is your feature request related to a problem? Please describe.**

When a solution is provided with a re-assignment, the analyzer bails out of a lot of code paths.

```javascript
export function twoFer(name = 'you') {
const whomst = name
return `One for me, and one for ${whomst}.`
}
```

When a solution is provided with a re-assignment of the named argument, the analyzer doesn't recognise the shadowing:

```javascript
export function twoFer(name) {
name = name ? name : "you"
return `One for me, and one for ${name}.`
}
```

**Which exercise**
`two-fer`

**Describe the solution you'd like**

Simple re-assignments like the one above should be recognised and _disapproved_. They don't add any value to the solution.

Re-assignments of the named arguments should be recognised and _disapproved_. https://github.com/exercism/javascript-analyzer/issues/52#issuecomment-750298061

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.