Skip to content

Commit

Permalink
Warn on use of deprecated class literal
Browse files Browse the repository at this point in the history
  • Loading branch information
minichate committed Nov 29, 2015
1 parent b00015d commit f4cca48
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
10 changes: 0 additions & 10 deletions lib/helpers/ember-core.js
Expand Up @@ -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);
}
});
Expand Down
6 changes: 4 additions & 2 deletions test/lib/rules/disallow-arraycontroller.js
Expand Up @@ -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();
}
Expand Down
6 changes: 4 additions & 2 deletions test/lib/rules/disallow-coreview.js
Expand Up @@ -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();
}
Expand Down
6 changes: 4 additions & 2 deletions test/lib/rules/disallow-objectcontroller.js
Expand Up @@ -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();
}
Expand Down

0 comments on commit f4cca48

Please sign in to comment.