Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer a rule for every jQuery feature #112

Open
8 of 94 tasks
edg2s opened this issue Sep 25, 2019 · 8 comments
Open
8 of 94 tasks

Offer a rule for every jQuery feature #112

edg2s opened this issue Sep 25, 2019 · 8 comments

Comments

@edg2s
Copy link
Member

edg2s commented Sep 25, 2019

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:

  • $x.add()
  • $x.addBack()
  • $x.after()
  • $x.append()
  • $x.appendTo()
  • $x.before()
  • $x.children()
  • $x.clearQueue()
  • $x.constructor()
  • $x.contents()
  • $x.delay()
  • $x.dequeue()
  • $x.detach()
  • $x.empty()
  • $x.end()
  • $x.eq()
  • $x.extend()
  • $x.finish()
  • $x.first()
  • $x.get()
  • $x.height()
  • $x.index()
  • $x.init()
  • $x.innerHeight()
  • $x.innerWidth()
  • $x.insertAfter()
  • $x.insertBefore()
  • $x.last()
  • $x.next()
  • $x.nextAll()
  • $x.nextUntil()
  • $x.not()
  • $x.off()
  • $x.offset()
  • $x.offsetParent()
  • $x.on()
  • $x.one()
  • $x.outerHeight()
  • $x.outerWidth()
  • $x.parentsUntil()
  • $x.position()
  • $x.prepend()
  • $x.prependTo()
  • $x.prev()
  • $x.prevAll()
  • $x.prevUntil()
  • $x.promise()
  • $x.pushStack()
  • $x.queue()
  • $x.remove()
  • $x.removeAttr()
  • $x.removeProp()
  • $x.replaceAll()
  • $x.replaceWith()
  • $x.scrollLeft()
  • $x.scrollTop()
  • $x.siblings()
  • $x.slice()
  • $x.stop()
  • $x.toArray()
  • $x.triggerHandler()
  • $x.width()

And here are the utilites:

  • $._data()
  • $._evalUrl()
  • $._queueHooks()
  • $._removeData()
  • $.ajaxPrefilter()
  • $.ajaxSetup()
  • $.ajaxTransport()
  • $.Animation()
  • $.Callbacks()
  • $.cleanData()
  • $.clone()
  • $.css()
  • $.dequeue()
  • $.error()
  • $.escapeSelector()
  • $.Event()
  • $.fx()
  • $.hasData()
  • $.htmlPrefilter()
  • $.isXMLDoc()
  • $.makeArray()
  • $.noConflict()
  • $.parseXML()
  • $.queue()
  • $.ready()
  • $.readyException()
  • $.removeAttr()
  • $.removeEvent()
  • $.speed()
  • $.style()
  • $.Tween()
  • $.uniqueSort()
@stof
Copy link
Contributor

stof commented Sep 26, 2019

That would be great.

@edg2s
Copy link
Member Author

edg2s commented Sep 28, 2019

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

Same for removeProp

@stof
Copy link
Contributor

stof commented Sep 30, 2019

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

@stof
Copy link
Contributor

stof commented Sep 30, 2019

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

and $.ajax* belong to no-ajax

edg2s added a commit that referenced this issue Sep 30, 2019
edg2s added a commit that referenced this issue Sep 30, 2019
edg2s added a commit that referenced this issue Sep 30, 2019
edg2s added a commit that referenced this issue Sep 30, 2019
edg2s added a commit that referenced this issue Sep 30, 2019
jdforrester pushed a commit that referenced this issue Sep 30, 2019
jdforrester pushed a commit that referenced this issue Sep 30, 2019
jdforrester pushed a commit that referenced this issue Sep 30, 2019
jdforrester pushed a commit that referenced this issue Sep 30, 2019
edg2s added a commit that referenced this issue Oct 14, 2019
@edg2s
Copy link
Member Author

edg2s commented Oct 14, 2019

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

  • no-dimensions: inner/outer width/height
  • no-events: on/off/one/live (and no-event-shorthand?)

@jdforrester
Copy link
Member

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

jdforrester pushed a commit that referenced this issue Oct 15, 2019
edg2s added a commit that referenced this issue Oct 16, 2019
* Dynamically build an eslintrc with all rules enabled.
* Use a local devDependency, so code is linted against HEAD
  of eslint-plugin-no-jquery.
@edg2s
Copy link
Member Author

edg2s commented Oct 16, 2019

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

edg2s added a commit that referenced this issue Oct 16, 2019
* Dynamically build an eslintrc with all rules enabled.
* Use a eslint-plugin-rulesdir to load latest rules directly.
jdforrester pushed a commit that referenced this issue Oct 16, 2019
* Convert indentation to tabs in package.json

* Create files that test all methods/utils for tracking #112

* Dynamically build an eslintrc with all rules enabled.
* Use a eslint-plugin-rulesdir to load latest rules directly.
@edg2s
Copy link
Member Author

edg2s commented Oct 8, 2020

Related: #170, #268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants