How to lint legacy modes (SQL) in CM6?

Hey, I am having trouble linting legacy mode pgSQL input in CodeMirror 6. For example I would like the user so see misplaced semicolons or misspelled keywords. I found nothing alike in the examples, the only piece of relevant code I found was this codesandbox.io. However, the legacy modes don’t seem to have something similar to import { javascript, esLint } from "@codemirror/lang-javascript"; if I am not mistaken, I also wouldn’t know which linter to put here linter(esLint(new Linter())). All in all I am a bit lost on how to approach this, any pointers?

Linting isn’t really integrated with parsing (unless someone happens to write a linter on top of the Lezer syntax tree, but that doesn’t really exist yet), so there’s no difference between how to lint legacy and other modes: find a linter that can run in the browser, or set up a server-side linter that you can access via HTTP, and wire it up to the lint package.

1 Like