eslint-plugin-ember
eslint-plugin-ember copied to clipboard
False negative for jquery-ember-run for many jquery element references
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.
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.