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

Create rule generator utilities #55

Closed
5 tasks done
edg2s opened this issue Jan 22, 2019 · 2 comments
Closed
5 tasks done

Create rule generator utilities #55

edg2s opened this issue Jan 22, 2019 · 2 comments

Comments

@edg2s
Copy link
Member

edg2s commented Jan 22, 2019

Many rules are identical to others but for some string constant, for example:

  • Collection methods: $div.hide(), $div.find(), $div.parent() ...
  • Collection properties: $div.selector, $div.context ...
  • Utilities: $.isFunction(), $.isNumeric(), $.contains() ...
  • Utility properties: $.noop, $.browser, $.boxModel ...
  • Combined methods and utilites: $.each + $div.each()
edg2s added a commit that referenced this issue Jan 23, 2019
Creates four generators:
* createCollectionMethodRule: $(...).method(...)
* createCollectionPropertyRule: $(...).property
* createUtilMethodRule: $.method(...)
* createUtilPropertyRule: $.property

Not touched by this change are rules with more complex criteria,
and rules where the distinction hasn't been made between util
methods and collection methods e.g. $.text() and $(...).text().

Doesn't touch the tests to ensure no functionality is changed.

Part of #55
jdforrester pushed a commit that referenced this issue Jan 23, 2019
Creates four generators:
* createCollectionMethodRule: $(...).method(...)
* createCollectionPropertyRule: $(...).property
* createUtilMethodRule: $.method(...)
* createUtilPropertyRule: $.property

Not touched by this change are rules with more complex criteria,
and rules where the distinction hasn't been made between util
methods and collection methods e.g. $.text() and $(...).text().

Doesn't touch the tests to ensure no functionality is changed.

Part of #55
@edg2s edg2s mentioned this issue Jan 24, 2019
@edg2s
Copy link
Member Author

edg2s commented Feb 20, 2019

We should probably also create a rule generator for the ambiguous collection method + utility method cases (e.g. no-each = no-each-util + no-each-collection) as that happens enough time in the library. We can then audit that list and create separate method/util rules for them and deprecate the ambiguous rules.

@edg2s edg2s changed the title De-duplicate code Create rule generator utilities Dec 20, 2019
@edg2s
Copy link
Member Author

edg2s commented Mar 16, 2020

The last utility was introduced in 557523d, so this task is done.

@edg2s edg2s closed this as completed Mar 16, 2020
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

1 participant