fi3ework/vite-plugin-checker

Process exit not honored when using multiple checkers

philipgriffin opened this issue · 2 comments

Describe the bug

When using multiple checkers a build does not fail if errors are reported within a particular checker.

Reproduction

  1. Setup the vite.config.ts as follows:
export default defineConfig({
  plugins: [
    checker({
      typescript: true,
      eslint: {
        lintCommand: 'eslint "./src/**/*.{ts,tsx}"',
      },
    })
  ],
});
  1. Create an ESLint error in your application. Ensure there are no TS errors, only an ESLint error.

  2. Build your application

Expected behavior

The build should fail however, it succeeds.

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
    Memory: 44.77 GB / 63.75 GB
  Binaries:
    Node: 18.18.2 - C:\nodejs\node.EXE
    Yarn: 1.22.21 - C:\nodejs\yarn.CMD
    npm: 10.2.4 - C:\nodejs\npm.CMD
    pnpm: 8.12.0 - C:\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.61)
    Internet Explorer: 11.0.22621.1

Additional context

If you set the checker config typescript to false, the plugin will work as expected and cancel the build due to ESLint issues.

The issue is that multiple error codes are not being honoured, they are being ignored and the build is succeeding.

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

I have added a PR showing the offending code and a potential solution.
#288

We are also facing this issue.