diff --git a/AUTHORS.txt b/AUTHORS.txt index e193d52..5720b0d 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -2,13 +2,16 @@ Burnashov Evgeny Chad Hietala Chris Thoburn David J. Hamilton +Edilberto Ruvalcaba Edilberto Ruvalcaba Ilya Radchenko Justin Lan Katie Gengler Kyle Turney Marc Lynch +Marc Lynch Mikael Riska +Nathaniel Furniss Quinn C. Hoyer Robert Jackson Ryunosuke Sato diff --git a/lib/rules/no-jquery-methods.js b/lib/rules/no-jquery-methods.js index cff2779..45886d5 100644 --- a/lib/rules/no-jquery-methods.js +++ b/lib/rules/no-jquery-methods.js @@ -10,12 +10,11 @@ function getMessage(blackListName) { } function isJQueryCaller(node, name = null) { - let oName = get(node, 'object.callee.object.name') === 'Ember'; let pName = get(node, 'object.callee.property.name') === '$'; let cName = get(node, 'object.callee.name') === '$'; let lName = get(node, 'object.name') === name; - return oName || pName || cName || lName; + return pName || cName || lName; } function getLocalImportName(node, sourceName) { diff --git a/tests/lib/rules/no-jquery-methods.js b/tests/lib/rules/no-jquery-methods.js index a33b0f0..fc95342 100644 --- a/tests/lib/rules/no-jquery-methods.js +++ b/tests/lib/rules/no-jquery-methods.js @@ -56,6 +56,24 @@ ruleTester.run('no-jquery-methods', rule, { } });`, options: [BLACKLISTMETHOD] + }, + { + code: ` + export default Ember.Component({ + init() { + Ember.get().add(); + } + });`, + options: [BLACKLISTMETHOD] + }, + { + code: ` + export default Ember.Component({ + init() { + this.$().add(); + } + });`, + options: [] } ], invalid: [