For AI agents: the complete documentation index is available at https://vite-plugin-eslint2.modyqyw.top/llms.txt, the full documentation bundle is available at https://vite-plugin-eslint2.modyqyw.top/llms-full.txt, and this page is available as Markdown at https://vite-plugin-eslint2.modyqyw.top/guide/faq.md.
  • English
  • FAQ

    Should I use this plugin?

    Usually not. Read Why & Why not? for the cases where the plugin helps, and for the cases where your editor, the CLI or CI already cover it.

    Turn the plugin on when you want errors and warnings while Vite runs. Set lintInWorker so the checks stay off the build thread.

    Cache looks broken?

    1. Delete the cache file.
    2. Fix the problem by hand.
    3. Restart Vite.

    The plugin is slow?

    The plugin lints on the main thread by default. That can block the build.

    Set lintInWorker to keep Vite responsive. Results print to the console.

    You can also run ESLint next to Vite instead of inside it. @nabla/vite-plugin-eslint and vite-plugin-checker are other choices.

    import { defineConfig } from "vite";
    import eslint from "vite-plugin-eslint2";
    
    export default defineConfig({
      plugins: [eslint({
        fix: true,
        lintInWorker: true,
        lintOnStart: true,
      })],
    });

    fix rewrites files while you work. Drop it if that does not suit your setup.

    Why is the error output all red?

    Vite's native error overlay does not render PluginContext.warn output. It shows ESLint's ANSI-colored stylish output verbatim, so the color distinctions disappear in the browser.

    These limits are tracked upstream in #2076, #6274 and #8327.

    Set customOverlay: true to render the results natively. Errors and warnings get separate styling.