Coffeescript and Backbone.js + linting issue with grunt.js -
i'm having bit of issue class extending backbone.model.
using next class …
class turtles extends backbone.model idattribute: "_id" legs: [0,1,3,5] urlroot: '/turtles' module.exports = turtles
grunt.js throwing error when linting.
[l21:c18] 'turtles' defined. function turtles() {
the output of compile js file looks this:
(function() { var turtles, __hasprop = {}.hasownproperty, __extends = function(child, parent) { (var key in parent) { if (__hasprop.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; homecoming child; }; turtles = (function(_super) { __extends(turtles, _super); function turtles() { homecoming turtles.__super__.constructor.apply(this, arguments); } turtles.prototype.idattribute = "_id"; turtles.prototype.points = [0, 1, 3, 5]; turtles.prototype.categories = ['story', 'tech', 'design', 'bug']; turtles.prototype.urlroot = '/cards'; homecoming turtles; })(backbone.model); module.exports = turtles; }).call(this);
this output similar views have extended using class application extends backbone.view
, i'm not sure why model failing linting when views , collections arent.
that beingness said, replacing class turtles extends backbone.model
turtles = backbone.model.extend
works find , causes no errors.
just wondered if has had experience before, or perhaps can spot issue.
thanks
backbone.js coffeescript gruntjs
No comments:
Post a Comment