iamcco / diagnostic-languageserver

diagnostic language server integrate with linters
MIT License
418 stars 28 forks source link

Support different formatters' outputs. #43

Open carlitux opened 3 years ago

carlitux commented 3 years ago

Support any other output format from formatters?

Looking a way to get eslint working without writing do disk with doesWriteToFile I saw documentation that says:

This option has the same effect as --fix with one difference: the fixes are not saved to the file system. This makes it possible to fix code from stdin (when used with the --stdin flag).

Because the default formatter does not output the fixed code, you'll have to use another one (e.g. json) to get the fixes. Here's an example of this pattern

getSomeText | eslint --stdin --fix-dry-run --format=json

This flag can be useful for integrations (e.g. editor plugins) which need to autofix text from the command line without saving it to the filesystem.

Which output is a json with a field output I don't think it is a standard as I didn't find references about it, maybe I am wrong.

But would be good a way to configure these kind of formats.