diff --git a/src/components/layers/JSONEditor.jsx b/src/components/layers/JSONEditor.jsx index 05b23f4..2b8f6a8 100644 --- a/src/components/layers/JSONEditor.jsx +++ b/src/components/layers/JSONEditor.jsx @@ -15,9 +15,6 @@ import jsonlint from 'jsonlint' import stringifyPretty from 'json-stringify-pretty-compact' import '../util/codemirror-mgl'; -// This is mainly because of this issue also the API has changed, see comment in file -import '../../vendor/codemirror/addon/lint/json-lint' - class JSONEditor extends React.Component { static propTypes = { diff --git a/src/vendor/codemirror/addon/lint/json-lint.js b/src/vendor/codemirror/addon/lint/json-lint.js deleted file mode 100644 index 5c80a84..0000000 --- a/src/vendor/codemirror/addon/lint/json-lint.js +++ /dev/null @@ -1,31 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Depends on fork of jsonlint from -// becuase of -var jsonlint = require("jsonlint"); -var CodeMirror = require("codemirror"); - -CodeMirror.registerHelper("lint", "json", function(text) { - var found = []; - - // NOTE: This was modified from the original to remove the global, also the - // old jsonlint API was 'jsonlint.parseError' its now - // 'jsonlint.parser.parseError' - jsonlint.parser.parseError = function(str, hash) { - var loc = hash.loc; - found.push({ - from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), - to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), - message: str - }); - }; - - try { - jsonlint.parse(text); - } - catch(e) { - // Do nothing we catch the error above - } - return found; -});