I want to check if there are lint errors

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.
});

It looks like the current lint.js addon code doesn’t provide a way for external code to get at the lint results. I’d be happy to review a pull request that adds a way to retrieve those, though.

Thank for the response.

I’m gonna look into it, if I found a solution I will make a PR.