I don't think adding an option called failOnError solves this problem. To fix this, we need to pass the context and avoid the error.
I think we only need to quit the process if the lintOnStart option is enabled and an error is checked, which would request the user to deal with the error that exists first to avoid caching issues ⬇️, which is exactly what this plugin currently behaves like.
I apologize that I may not have expressed my opinion correctly and completely before. And sorry I am late in response.
Normally, enabling
lintInWorker
would only show errors and warnings in the console, but otherwise in the console and the browser.Now, with
chokidar
enabled andlintInWorker
disabled, I can't pass the context to the function (see https://github.com/ModyQyW/vite-plugin-stylelint/blob/v5.1.1/src/index.ts#L78-L98 comments) because it causes an error and just quits the Vite process. This leads to the problem mentioned in https://github.com/nuxt-modules/stylelint/issues/89, where the plugin only displays error and warning messages in the console, not in the browser.I don't think adding an option called
failOnError
solves this problem. To fix this, we need to pass the context and avoid the error.I think we only need to quit the process if the
lintOnStart
option is enabled and an error is checked, which would request the user to deal with the error that exists first to avoid caching issues ⬇️, which is exactly what this plugin currently behaves like.Originally posted by @ModyQyW in https://github.com/ModyQyW/vite-plugin-stylelint/issues/50#issuecomment-1691082257