From f4cca4814bf788cf8008dd5ff8cd22ef5b3891dd Mon Sep 17 00:00:00 2001 From: Christopher Troup Date: Sun, 29 Nov 2015 13:51:25 -0500 Subject: [PATCH] Warn on use of deprecated class literal --- lib/helpers/ember-core.js | 10 ---------- test/lib/rules/disallow-arraycontroller.js | 6 ++++-- test/lib/rules/disallow-coreview.js | 6 ++++-- test/lib/rules/disallow-objectcontroller.js | 6 ++++-- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/lib/helpers/ember-core.js b/lib/helpers/ember-core.js index d691c3d..660b314 100644 --- a/lib/helpers/ember-core.js +++ b/lib/helpers/ember-core.js @@ -38,16 +38,6 @@ module.exports.prototype.findEmberClass = function(className) { return; } - var nextToken = _this.file.getTokenByRangeStart(node.range[1]); - if (nextToken.type !== 'Punctuator' || nextToken.value !== '.') { - return; - } - - var following = _this.file.getTokenByRangeStart(nextToken.range[1]); - if (following.value !== 'extend' && following.value !== 'create') { - return; - } - nodes.push(node); } }); diff --git a/test/lib/rules/disallow-arraycontroller.js b/test/lib/rules/disallow-arraycontroller.js index daf3be7..80da698 100644 --- a/test/lib/rules/disallow-arraycontroller.js +++ b/test/lib/rules/disallow-arraycontroller.js @@ -32,12 +32,14 @@ describe('lib/rules/disallow-arraycontroller', function () { }); } }, { - it: 'should not report', + it: 'should report', + errors: 1, code: function() { var foo = Ember.ArrayController; } }, { - it: 'should not report', + it: 'should report', + errors: 1, code: function() { Ember.ArrayController.foo(); } diff --git a/test/lib/rules/disallow-coreview.js b/test/lib/rules/disallow-coreview.js index 150d15e..225f45e 100644 --- a/test/lib/rules/disallow-coreview.js +++ b/test/lib/rules/disallow-coreview.js @@ -32,12 +32,14 @@ describe('lib/rules/disallow-coreview', function () { }); } }, { - it: 'should not report', + it: 'should report', + errors: 1, code: function() { var foo = Ember.CoreView; } }, { - it: 'should not report', + it: 'should report', + errors: 1, code: function() { Ember.CoreView.foo(); } diff --git a/test/lib/rules/disallow-objectcontroller.js b/test/lib/rules/disallow-objectcontroller.js index b73b0d3..077a9d1 100644 --- a/test/lib/rules/disallow-objectcontroller.js +++ b/test/lib/rules/disallow-objectcontroller.js @@ -32,12 +32,14 @@ describe('lib/rules/disallow-objectcontroller', function () { }); } }, { - it: 'should not report', + it: 'should report', + errors: 1, code: function() { var foo = Ember.ObjectController; } }, { - it: 'should not report', + it: 'should report', + errors: 1, code: function() { Ember.ObjectController.foo(); }