Open ortonomy opened 1 year ago
Yeah maybe this can always be disable in test env.
For now, you can update your config to disable the plugin manually
export default defineConfig((env) => ({
plugins: [
env.mode !== 'test' && eslintPlugin()
],
This plugin hangs with vitest 1.6 when running in vitest run, resulting in the message:
...
close timed out after 10000ms
Tests closed successfully but something prevents Vite server from exiting
You can try to identify the cause by enabling "hanging-process" reporter. See https://vitest.dev/config/#reporters
When I enabled the hanging-process reporter, one of the processes was this:
# WORKER
node:internal/async_hooks:202
node:internal/worker:214
file:///.../node_modules/@nabla/vite-plugin-eslint/src/index.mjs:25
file:///.../node_modules/vitest/node_modules/vite/dist/node/chunks/dep-B8QpfTwU.js:51091
file:///.../node_modules/vitest/node_modules/vite/dist/node/chunks/dep-B8QpfTwU.js:53832
When I removed the eslintPlugin()
from plugins, it doesn't hang. Thank you for the workaround, although in my case, the correct usage was this (vite.config.js):
import eslintPlugin from '@nabla/vite-plugin-eslint';
import { defineConfig } from 'vite';
export default ({ mode }) => {
return defineConfig({
plugins: [mode !== 'test' && eslintPlugin()],
test: {
reporters: ['default', 'hanging-process']
}
});
};
I see all the eslint plugin output in my testing runs which is distracting...