I use the application/json
linter and when the text changes I want to check if there are lint errors.
It is possible to check if there are lint errors? Or I should check if I can found the CodeMirror-lint-markers
on the page?
editor = CodeMirror.fromTextArea(document.getElementById("json-editor"), {
viewportMargin: Infinity,
lineNumbers: true,
indentUnit: 4,
indentSize: 4,
indentWithTabs: true,
tabSize: 4,
lineWiseCopyCut: true,
mode: "application/json",
gutters: ["CodeMirror-lint-markers"],
styleActiveLine: true,
lint: true,
});
editor.on("change", function(text) {
// Do something if there are no lint errors.
});