you-dont-need/You-Dont-Need-Lodash-Underscore

Add more suggestions for _.first

Open

#312 建立於 2021年5月2日

在 GitHub 查看
 (1 留言) (1 反應) (0 負責人)JavaScript (811 fork)batch import
enhancementhelp wanted

倉庫指標

Star
 (18,379 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Currently, the suggestion we get for _.first might not be relevant in all cases. Array.prototype.slice() returns an array. But _.first from lodash returns a non-array value. So this line should be something like this I guess:

"alternative": "Array.prototype.slice() or arr[0]"

Also, I think we should add more aliases here. For example _.head should be prevented when _.first is prevented, because they're basically the same.

貢獻者指南