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

Add more suggestions for _.first

Open

#312 geöffnet am 2. Mai 2021

Auf GitHub ansehen
 (1 Kommentar) (1 Reaktion) (0 zugewiesene Personen)JavaScript (811 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (18.379 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide