exercism / exercism/javascript-analyzer
Improve two-fer: recognise re-assignment
- 主要言語
- TypeScript
- スター
- 16
- フォーク
- 21
- 平均マージ
- 6時間 53分
- マージ済み PR(30日)
- 2
説明
**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
コントリビューションガイド
調査の方向性
まず、`two-fer` 演習の analyzer ロジックを追跡し、名前付き引数への代入をどのように処理しているかを確認します。Issue にある 2 つの例を比較し、次に単純な再代入のカバレッジを追加して、そのような解決策が却下されることを確認します。Payload にはソースファイルもテストパスも記載されていません。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- testing, tooling
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100