our recommendation for language providers so far is different and independent of a build task. What we recommend is the following:
single file language like linters should compute errors on file open and clear them on file close. Reason is that these languages usually don't have a project context.
It looks to me like the hadolint extension should clear the Problems list once a file is closed, as it is a single-file linter.
If you open a Dockerfile that has issues but then close it again, the list of problems remains. Referencing https://github.com/microsoft/vscode/issues/59363
It looks to me like the hadolint extension should clear the Problems list once a file is closed, as it is a single-file linter.