wikimedia / eslint-plugin-no-jquery

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

Offer a rule for every jQuery feature #112

Open edg2s opened 4 years ago

edg2s commented 4 years ago

A good place to start for utilities and collection methods is: Object.keys($.fn).filter(k=>typeof $.fn[k] === 'function').sort() and Object.keys($).filter(k=>typeof $[k] === 'function').sort()

Update: Here are the methods we don't have rules for:

And here are the utilites:

stof commented 4 years ago

That would be great.

edg2s commented 4 years ago

removeAttr should be added to the no-attr rule, c.f. no-data.

Same for removeProp

stof commented 4 years ago

And $.hasData() should be added to no-data (as well as the lower-level _data and _removeData)

stof commented 4 years ago

$.Tween(), $.Animation() and $.fx() are related to animations IIRC, so they might belong to no-animate.

and $.ajax* belong to no-ajax

edg2s commented 4 years ago

We may want to group some of these rules, like no-class

jdforrester commented 4 years ago

Group with individual rules available if people want them, and most-specific-wins?

edg2s commented 4 years ago

See #163 for grouping. I think individual rules should be created when there is a use case/request.

edg2s commented 3 years ago

Related: #170, #268