wikimedia / eslint-plugin-no-jquery

Control allowance of certain jQuery functions, and suggest or autofix alternatives.
MIT License
31 stars 8 forks source link

toArray() should be detected as breaking out of the jQuery collection #96

Closed stof closed 5 years ago

stof commented 5 years ago

I have false positives for no-jquery/no-map or similar methods right now, for code like this:

$col.toArray().map(someCallback)

In this case, .map is already a call to Array.prototype.map, not to jQuery.map, because toArray() returns an array, not a jQuery collection.

stof commented 5 years ago

btw, both no-map and no-map-collection are catching that call.