1 // Depends on jsonlint.js from https://github.com/zaach/jsonlint
3 // declare global: jsonlint
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", "json", function(text
) {
17 jsonlint
.parseError = function(str
, hash
) {
19 found
.push({from: CodeMirror
.Pos(loc
.first_line
- 1, loc
.first_column
),
20 to
: CodeMirror
.Pos(loc
.last_line
- 1, loc
.last_column
),
23 try { jsonlint
.parse(text
); }