Accessing linting errors on update

Hey,

I would like to figure out after editor update, if there are any linting errors. Is there a way to do that?

Since the logic for linting json is fairly simple. I ended up copying logic from linter (JSON.parse) in the EditorView.updateListener to figure out if the value is valid.

There is now—@codemirror/lint 0.19.1 adds a diagnosticCount(state) function.

Is there any documentation on how this can be used with CodeMirror? I can see an exported linter function (https://github.com/codemirror/lint/blob/main/src/lint.ts#L271) but it’s unclear what parameters are required.

I’ve just found CodeMirror 6 Reference Manual, so perhaps I posted prematurely.