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

Add more suggestions for _.first

Open

#312 aperta il 2 mag 2021

Vedi su GitHub
 (1 commento) (1 reazione) (0 assegnatari)JavaScript (811 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (18.379 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor