Sha256: f2298f6c84de74212b062096b9753f2e2c0b010464309d1eb77dff5e1d51cc58

Contents?: true

Size: 851 Bytes

Versions: 14

Compression:

Stored size: 851 Bytes

Contents

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

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

14 entries across 14 versions & 2 rubygems

Version Path
codemirror-rails-3.17 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
bonethug-0.0.17 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.16 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.15 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.14 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.13 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.12 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.11 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.10 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
codemirror-rails-3.16 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js
bonethug-0.0.7 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.6 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
bonethug-0.0.5 skel/project_types/silverstripe3/public/abc/lib/codemirror/addon/lint/coffeescript-lint.js
codemirror-rails-3.15 vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js