Closed stereokai closed 1 year ago
I've taken 1. & 4. into the latest release, thanks for pointing out those. While I'm not against 3, your change 2 feels like you should provide your own logger because this since really a personal need to not print path too long.
Hi @ArnaudBarre, I apologize, I missed your review from August 11. Please allow me to reply now:
I've taken 1. & 4. into the latest release, thanks for pointing out those.
Happy to hear that!
While I'm not against 3, your change 2 feels like you should provide your own logger because this since really a personal need to not print path too long.
I am not familiar with the ability to provide own logger. Is it simply using the builtin ESLint formatters?
Yes I don't now the exact API but if you pass a path to the formatter
option of the plugin it will be passed to ESLint.loadFormatter
. I agree this is not as simple of providing a callback but I least you can get full control.
Cool. What if you allowed either to use ESLint.loadFormatter
and as an alternative, allow passing a custom formatter, so a custom behavior can be implemented? (on a different property, say customFormatter
) Then everybody wins :)
Because ESLint doesn't support passing a function, this could be done by allowing function for the formatter option directly. But this requires passing back message from the worker to the main thread which is ok but not one liner.
What I mean is to simply expose the path that is log and the error level (this is already available in the plugin scope) to the user, and then they can pass in a function to the plugin that can accept that and they can log it however they like, to fit their desired developer experience :)
On Thu, Nov 16, 2023, 15:11 Arnaud Barré @.***> wrote:
Because ESLint doesn't support passing a function, this could be done by allowing function for the formatter option directly. But this requires passing back message from the worker to the main thread which is ok but not one liner.
— Reply to this email directly, view it on GitHub https://github.com/nabla/vite-plugin-eslint/pull/21#issuecomment-1814509219, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUPTLI4ZFXAAAUDJXG6M23YEYNKXAVCNFSM6AAAAAA3BM4ED6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJUGUYDSMRRHE . You are receiving this because you authored the thread.Message ID: @.***>
Available in v2 🎉
Awesome! Thank you very much 😎
{ errorOnUnmatchedPattern: false }
would cause the plugin to fail