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

Extend no-es6-methods to detect common jQuery and Lodash uses #36

Merged
merged 3 commits into from
Jan 29, 2020
Merged

Extend no-es6-methods to detect common jQuery and Lodash uses #36

merged 3 commits into from
Jan 29, 2020

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Dec 31, 2019

As discussed in #12, eslint-plugin-es5 flags uses of jQuery and Lodash methods. It's not practical to fully solve this problem without full-fledged type analysis, but it seems straightforward to catch some common scenarios. Here's my attempt at doing so. Feedback welcome.

Factor out the checks for permitted functions to facilitate further
development. Use an early return to simplify the code.

Add a unit test covering the pre-existing Lodash support.

Unrelated: Better English style in README.md
@nkt nkt merged commit 088d440 into nkt:master Jan 29, 2020
@joshkel joshkel deleted the es6-method-handling branch January 29, 2020 19:23
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this pull request Jun 13, 2020
I stumbled on https://github.com/nkt/eslint-plugin-es5 about a year ago but it had too many false-positives when used with jQuery.  Most of that (nkt/eslint-plugin-es5#12) appears to have been resolved with v1.5.0, specifically nkt/eslint-plugin-es5#36.  This won't catch everything but I *think* it shouldn't have many false positives, as long as things like jQuery's `.find` are used on the same line as `$`, whether `jQuery` or as a variable name; we're inconsistent on that front, but it's not a bad idea to encourage it.
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this pull request Jun 13, 2020
I stumbled on https://github.com/nkt/eslint-plugin-es5 about a year ago but it had too many false-positives when used with jQuery.  Most of that (nkt/eslint-plugin-es5#12) appears to have been resolved with v1.5.0, specifically nkt/eslint-plugin-es5#36.  This won't catch everything but I *think* it shouldn't have many false positives, as long as things like jQuery's `.find` are used on the same line as `$`, whether `jQuery` or as a variable name; we're inconsistent on that front, but it's not a bad idea to encourage it.
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this pull request Jun 23, 2020
I stumbled on https://github.com/nkt/eslint-plugin-es5 about a year ago but it had too many false-positives when used with jQuery.  Most of that (nkt/eslint-plugin-es5#12) appears to have been resolved with v1.5.0, specifically nkt/eslint-plugin-es5#36.  This won't catch everything but I *think* it shouldn't have many false positives, as long as things like jQuery's `.find` are used on the same line as `$`, whether `jQuery` or as a variable name; we're inconsistent on that front, but it's not a bad idea to encourage it.
wiki-ST47 pushed a commit to wiki-ST47/twinkle that referenced this pull request Sep 2, 2020
I stumbled on https://github.com/nkt/eslint-plugin-es5 about a year ago but it had too many false-positives when used with jQuery.  Most of that (nkt/eslint-plugin-es5#12) appears to have been resolved with v1.5.0, specifically nkt/eslint-plugin-es5#36.  This won't catch everything but I *think* it shouldn't have many false positives, as long as things like jQuery's `.find` are used on the same line as `$`, whether `jQuery` or as a variable name; we're inconsistent on that front, but it's not a bad idea to encourage it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants