wikimedia / eslint-plugin-no-jquery

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

Rule to forbid using contains #100

Closed stof closed 5 years ago

stof commented 5 years ago

The contains collection method can be replaced with the native Element.contains API (with a caveat that the native API considers than an element contains itself, while jQuery does not).

edg2s commented 5 years ago

Note that contains is a utility, not a collection method: https://api.jquery.com/jQuery.contains/

stof commented 5 years ago

indeed