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/why.md.
  • English
  • Why & Why not?

    Why

    This project was forked from gxmari007/vite-plugin-eslint. The original had issues and pull requests piling up with nobody maintaining it. I emailed the author and got no reply.

    My fork added what I needed at the time. That was ESLint v8 support, the eslintPath, lintInWorker, lintOnStart and lintDirtyOnly options, and a forced ignore for virtual modules. Back then it was published as @modyqyw/vite-plugin-eslint. I renamed it to vite-plugin-eslint2 in early 2023 so it is easier to find.

    Why not

    Most projects do not need this plugin.

    Your editor already shows the same problems. VS Code needs the ESLint extension. WebStorm ships the feature.

    You can also run ESLint from the CLI or in CI.

    Webpack projects use eslint-webpack-plugin for the same job.

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

    Alternatives

    @nabla/vite-plugin-eslint and vite-plugin-checker cover similar ground. Pick the one that fits your needs.

    ESLint only checks JavaScript and TypeScript. To run Stylelint in Vite with the same setup, use vite-plugin-stylelint.

    Acknowledge

    Initially forked from gxmari007/vite-plugin-eslint.

    Contributors

    This project was created by ModyQyW.

    Thanks to all contributors for their contributions!

    Sponsors

    If this package is helpful to you, please consider sponsoring. It keeps the project developed and maintained.