Sha256: e571b8e42bb16b26155685f5530fd7286406d94cac316d682917aa55f229ca58

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

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

CodeMirror.coffeeValidator = 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;
};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codemirror-rails-3.14 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js