In a Mastodon post, @ssastry said:
Related but tangentially, for a while now, I have been thinking that perhaps most of the Linter (analysis) code in Parsoid should actually be move out of core Parsoid. There is really nothing special about what Parsoid does in the Linting analysis. It just analyzes the DOM. Except for some types of lints that need information from tokenizing, these code be done in an extension or an external tool.
But, there are probably some product features and reasons why certain kinds of lints would need to be done synchronously (Parsoid or an extensions) rather than by an external tool. Ex: DiscussionTools.
However, it should be possible for external tools to analyze pages and post lints to the linter api which opens the possibility for bots and other tools to add more project-specific linting abilities.
I replied:
yes!! I was actually going to file a bug about 1) allowing extensions to add Lint errors during parse so it doesn't all need to be in Parsoid
- after that, allowing Lua modules to add Lint errors (e.g. T304309).
I worry about having truly external tools add lint errors just because the update frequency may not be what editors want...but I think that if extensions + Lua could do it, most of the use-case would be addressed
It may make sense to block this task on T330725: Merge Linter extension into MediaWiki core or not, mostly depends on whether this functionality is going to be in Parsoid or MediaWiki core.