1 // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js
3 // declare global: coffeelint
6 if (typeof exports
== "object" && typeof module
== "object") // CommonJS
7 mod(require("../../lib/codemirror"));
8 else if (typeof define
== "function" && define
.amd
) // AMD
9 define(["../../lib/codemirror"], mod
);
10 else // Plain browser env
12 })(function(CodeMirror
) {
15 CodeMirror
.registerHelper("lint", "coffeescript", function(text
) {
17 var parseError = function(err
) {
18 var loc
= err
.lineNumber
;
19 found
.push({from: CodeMirror
.Pos(loc
-1, 0),
20 to
: CodeMirror
.Pos(loc
, 0),
22 message
: err
.message
});
25 var res
= coffeelint
.lint(text
);
26 for(var i
= 0; i
< res
.length
; i
++) {
30 found
.push({from: CodeMirror
.Pos(e
.location
.first_line
, 0),
31 to
: CodeMirror
.Pos(e
.location
.last_line
, e
.location
.last_column
),