[TIL] vite-plugin-checker

TIL about vite-plugin-checker.

Vite's dev server transpiles files on the fly without type-checking them, so a broken type can slip right through and only get caught later, at build time or in CI. vite-plugin-checker closes that gap.

Once added to vite.config.ts, it runs your configured checkers (TypeScript, vue-tsc, ESLint, Stylelint...) in a separate process alongside the dev server, and surfaces errors in two places while you're developing:

Example config:

import checker from "vite-plugin-checker";

export default defineConfig({
  plugins: [
    checker({
      typescript: true,
      eslint: {
        lintCommand: 'eslint "./src/**/*.{ts,tsx}"',
      },
    }),
  ],
});

Nice for catching type and lint errors immediately during development, instead of waiting for a build or CI run to point them out.