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

False negative for jquery-ember-run for many jquery element references #1889

Open
tehhowch opened this issue Jun 15, 2023 · 1 comment
Open
Labels

Comments

@tehhowch
Copy link

tehhowch commented Jun 15, 2023

import $ from "jquery";
const $el = $("#item");
$el.on("click", () => this.handle());

passes, but it should fail.

import $ from "jquery";
const $parent = $("<div><button type='button'>Click Me</button></div>");
$parent.find("button").on("click", () => this.handle());

should also fail, but passes.

I agree that the rule should not trigger for arbitrary someVar.on("click", callback) scenarios, but when the property is known to be a jQuery element reference, it should trigger.

@tehhowch tehhowch changed the title False negative for jquery-ember-run when using saved jquery element reference False negative for jquery-ember-run for many jquery element references Jun 15, 2023
@bmish bmish added the Bug label Jun 15, 2023
@bmish
Copy link
Member

bmish commented Jun 15, 2023

Yeah that would be a good case to catch. Would require using our getNodeOrNodeFromVariable() helper (which uses findVariable from eslint-utils under the hood) to detect it.

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

No branches or pull requests

2 participants