Filter lint diagnostics when cursor position changes

It would be useful for us to be able to be able to filter lint diagnostics based on cursor position. The idea is that when a user is in the middle of typing some code (possibly with some autocomplete going on), we’d like to hide linter errors generated by the incomplete state of the code they’re currently typing.

The two ways I can see of doing this are:

  1. Reconfigure the linter with a new linter source
  2. Use CSS to hide lint markers and gutter markers for the current line

Neither is appealing. Reconfiguring the linter with a new source whenever the cursor changes seems highly likely to be inefficient, and conceptually wrong because the lint errors are still real and we just want to hide them in this context. CSS seems hacky and possibly imprecise. One option that occurs to me is to have some way to force the markerFilter options in the linter config and lint gutter config to be applied.

This sounds like you’re doing something sufficiently different from what @codemirror/lint provides that you should probably write a custom extension to manage your linting.

Fair enough. Thanks for replying.