You may be looking for the lint addon (demo here).
Any CodeMirror6 examples? Should have clarified that.
Not yet. But the docs for the lint package should get you pretty far.