Sha256: b7ef0333cf144367b0023e1d19fdf0d7675efdcbda90ccb20e6305e7c5da31c9

Contents?: true

Size: 882 Bytes

Versions: 11

Compression:

Stored size: 882 Bytes

Contents

// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js

// declare global: coffeelint

CodeMirror.registerHelper("lint", "coffeescript", function(text) {
  var found = [];
  var parseError = function(err) {
    var loc = err.lineNumber;
    found.push({from: CodeMirror.Pos(loc-1, 0),
                to: CodeMirror.Pos(loc, 0),
                severity: err.level,
                message: err.message});
  };
  try {
    var res = coffeelint.lint(text);
    for(var i = 0; i < res.length; i++) {
      parseError(res[i]);
    }
  } catch(e) {
    found.push({from: CodeMirror.Pos(e.location.first_line, 0),
                to: CodeMirror.Pos(e.location.last_line, e.location.last_column),
                severity: 'error',
                message: e.message});
  }
  return found;
});
CodeMirror.coffeeValidator = CodeMirror.lint.coffeescript; // deprecated

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
gump-0.1.6 server/assets/js/jquery.codemirror/addon/lint/coffeescript-lint.js
codemirror-rails-3.24 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
codemirror-rails-3.23 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
codemirror-rails-3.22 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
codemirror-rails-3.21 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
codemirror-rails-3.20 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
codemirror-rails-3.19 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
codemirror-rails-3.18 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
poly-cms-0.1.2 core/admin/assets/js/vendor/codemirror/addon/lint/coffeescript-lint.js
poly-cms-0.1.1 core/admin/assets/js/vendor/codemirror/addon/lint/coffeescript-lint.js
poly-cms-0.1.0 core/admin/assets/js/vendor/codemirror/addon/lint/coffeescript-lint.js