-
Notifications
You must be signed in to change notification settings - Fork 119
Description
The config option root is utilized during the configureServer operations of most checkers, but commands spawned in build mode do not use the root config. This causes some inconsistencies in behavior for some checkers like eslint and oxlint that have a lintCommand option.
For example with oxlint, the cwd of the spawn command is using root in server/watch mode:
https://github.com/fi3ework/vite-plugin-checker/blob/main/packages/vite-plugin-checker/src/checkers/oxlint/server.ts#L16
Whereas in build mode, all commands use process.cwd() as the cwd path, rather than root:
https://github.com/fi3ework/vite-plugin-checker/blob/main/packages/vite-plugin-checker/src/main.ts#L252
This inconsistency causes issues in monorepos where the expectation might be that the commands executed are from the point of view of root (the root of the repo, usually), rather than Vite's root directory (the root of the app/project).
I'm not sure if this would be a feature request or a bug, since I'm not sure of the implications of some of the other checkers utilizing root as part of their process.