Open denchiklut opened 1 year ago
Any progress on this? Seems like the only option is to revert to 0.4.9
Actually, the change seems to have been introduced in 0.5.6
Error: no errors were found.
IM GONNA REEEE
Happening for me with nuxt 3.8.2 on a fresh install/setup
Same for me? Any workaround for this?
Still an issue
Actually, the change seems to have been introduced in 0.5.6
I figured out where the problem got introduced, but there's been no addressing of it thus far
This line looks like it might be the root of the issue. https://github.com/fi3ework/vite-plugin-checker/commit/8dd49159bddd7e3e23dfa479323322808094d8b9#diff-7c457428fc11687ac503085166d754dc2dbdaa3df69069d3027272bda149ba5cR189
I found that while trawling through the diff between v0.5.5 and 0.5.6 https://github.com/fi3ework/vite-plugin-checker/compare/vite-plugin-checker%400.5.5...vite-plugin-checker%400.5.6
@james-yeoman I'm seeing the same. Unsure why it would log if Checker.logger is empty, maybe an oversight?
So the logger comes from Vite itself. I wonder why this plugin isn't receiving the logger from Vite... https://github.com/fi3ework/vite-plugin-checker/commit/8dd49159bddd7e3e23dfa479323322808094d8b9
Ok, so vite-plugin-checker is receiving the logger from vite, I'm just a dunce...
The actual problem, is that Checker.logger
is never populated, and the colouring of diagnostics and summaries are already handled by diagnosticToTerminalLog
and composeCheckerSummary
in vite-plugin-checker/src/logger.ts
.
There's currently no way of differentiating between an error, a warning, and a checker summary.
This is beyond what I can justify spending time on during work, but hopefully my findings help someone who can spend more time on open source to fix this
As a workaround, I've got a fork that I've added a bypass to in order to avoid erroring on an empty summary. It's not the cleanest, but it allows me to adopt the ESLint Flat Config without too much problem
:/ I use yarn and so can't reference the fork since this plugin uses pnpm...
guess I'm back to using yarn patches instead...
So, no solution to this so far? lol
Hey so I had the same problem and I managed to implement a workaround:
Vite offers the functionality to customize the logs: https://vitejs.dev/config/shared-options.html#customlogger
So I converted some errors from vite-plugin-checker to an info:
import { defineConfig, createLogger } from "vite";
import os from 'node:os'
const logger = createLogger()
const loggerErr = logger.error
logger.error = (msg, options) => {
if (msg.match(/.*\[ESLint\] Found 0 error and 0 warning.*/)) {
logger.info(msg, options)
return
}
if (msg.match(/.*\[TypeScript\] Found 0 errors. Watching for file changes.*/)) {
logger.info(msg.replace(os.EOL, ""), options)
return
}
loggerErr(msg, options)
}
export default defineConfig({
customLogger: logger
});
With those changes my output looks like this:
Hope this helps someone.
@fi3ework could this patch be merged into this repo? still happening on the latest version
Describe the bug
When
typescript check
option istrue
always getting this messageI tried to debug it and added log with
*** action
to themain.js
plugin source file.And since this action treaded as an Error on
line 182
we just added prefix ERROR.Reproduction
in vite config
Expected behavior
Action
{ type: 'console', payload: '\n[TypeScript] Found 0 errors. Watching for file changes.' }
should't be logged as an ErrorSystem Info